LINQ to SQL外部映射 [英] LINQ to SQL external mapping

查看:79
本文介绍了LINQ to SQL外部映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何为LINQ to SQL设置外部映射文件.我已经读过Ivan Latunov的博客文章,这引起了我的兴趣.问题是我不了解事情的发展.主要问题是:如果我只想修改xml映射文件,该怎么办?我是先创建.dbml文件,然后向MappingSource对象提供有关自定义xml文件的信息,还是有另一种更好的方法?

I don't know how to set up external mapping file for LINQ to SQL. I've read Ivan Latunov's blog post about it and it woke up my interest in it. The problem is that I don't understand how things should go. The main question is: what is the howto if I want only to modify xml mapping file? Do I first create .dbml file and then supply MappingSource object with information about the custom xml file or there is another better way?

推荐答案

查看

look into the SQLMetal utility (found by opening up a Visual Studio Command Prompt and typing the command in).

我认为这使您可以从数据库或现有dbml文件创建地图

I think this allows you to just create maps either from databases or from pre-existing dbml files

在您发表第一条评论后,我相信这篇文章可能与您要查找的内容稍微接近.它向您展示了如何在运行时加载自定义映射文件

After your first comment, I believe that this article is probably slightly closer to what you are looking for. It shows you how to load a custom mapping file at runtime

这篇关于LINQ to SQL外部映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆