ORM: 开发自己的Data Access Application Block - Part I
2008-12-06 10:15:45 来源:WEB开发网这个列表和大部分ORM没有什么太大的区别,大家已经司空见惯,实现起来也不会有什么太大的困难。对于大部分操作,我不会做详细的介绍。接下来我们来简要地看看这样一个AppBlock是如何实现的。
1. Data Mapping
我们首先来看看Data Mapping:实现Dataset中Table name和Stored Procedure Name的Mapping,以及Dataset 中的Field 和Stored procedure的参Parameter name的Mapping。
IDbParameterNameMapping
using System;
using System.Collections.Generic;
using System.Text;
namespace Artech.ApplicationBlock.DataMapping
{
/**//// <summary>
/// IStoredProcedureNameMapping defines the mapping between the data table name and the name of stored procedures to perform insertion, modification and deletion operation.
/// </summary>
public interface IStoredProcedureNameMapping
{
/**//// <summary>
/// Get the name of stored procedure to perform seletion operation.
/// </summary>
/// <param name="tableName">The name of the database table.</param>
/// <returns>The name of stored procedure to perform seletion operation</returns>
string GetSelectStoredProcedureName(string tableName);
/**//// <summary>
/// Get the name of stored procedure to perform insert operation.
/// </summary>
/// <param name="tableName">The name of the database table.</param>
/// <returns>The name of stored procedure to perform insertion operation</returns>
string GetInsertStoredProcedureName(string tableName);
/**//// <summary>
/// Get the name of stored procedure to perform modification operation.
/// </summary>
/// <param name="tableName">The name of the database table.</param>
/// <returns>The name of stored procedure to perform modification operation</returns>
string GetModifyStoredProcedureName(string tableName);
/**//// <summary>
/// Get the name of stored procedure to perform deletion operation.
/// </summary>
/// <param name="tableName">The name of the database table.</param>
/// <returns>The name of stored procedure to perform deletion operation</returns>
string GetDeleteStoredProcedureName(string tableName);
}
}
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››开发者眼中的Windows Phone和Android
- ››开发学院教你用SQL 语句最快速清空MySQL 数据表的...
- ››自己动手写iPhone wap浏览器之界面架构篇
- ››自己也能DIY个性真人QQ表情
- ››自己动手!巧法让酷狗动感歌词更完美
- ››自己编译Google Android内核的Linux源码
- ››自己写的一个jquery模板引擎(json比较好用)
- ››开发一个自己的HTML在线编辑器(一)
- ››开发一个自己的HTML在线编辑器(二)
更多精彩
赞助商链接