[LINQ to SQL]阅读笔记。
Getting Started
Getting Started
By using LINQ to SQL, you can use the LINQ technology to access SQL databases just as you would access an in-memory collection.
Typical Steps for Using LINQ to SQL
Creating the Object Model
从工具创建模型
- The Object Relational Designer
- visual studio 一部分
- The SQLMetal code-generation tool
- A code editor
选择生成的代码类型
- C#或者VB原代码
- 一个XML文件用做外部映射,因此代码中不用内嵌那么多信息
- 一个DBML文件,可以用于在生成代码之前做一些编辑
然后对生成的代码进行一些优化
Using the Object Model
使用LINQ to SQL的典型步骤(有些可选)
- 创建询查以从数据库获取信息
- 越写Insert, Update, 以及 Delete的一些默认行为(可选)
- 设置一些选项来检测和报告并行冲突设置
- 搭建一个继承体系
- 提供一个合适的用户界面
- 调测你的应用
其他
参考链接
(此处是底部)