开发学院数据库MSSQL Server ORM: 开发自己的Data Access Application Block -... 阅读

ORM: 开发自己的Data Access Application Block - Part I

 2008-12-06 10:15:45 来源:WEB开发网   
核心提示: 这个列表和大部分ORM没有什么太大的区别,大家已经司空见惯,ORM: 开发自己的Data Access Application Block - Part I(4),实现起来也不会有什么太大的困难,对于大部分操作,我不会做详细的介绍,接下来我们来简要地看看这样一个AppBlock是如何实现的

这个列表和大部分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);
  }
}

上一页  1 2 3 4 5 6 7 8 9  下一页

Tags:ORM 开发 自己

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接