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

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

 2008-12-06 10:15:45 来源:WEB开发网   
核心提示: DataAccessConfigurationElementusing System;using System.Collections.Generic;using System.Text;using System.Configuration;using System.Data;namesp

DataAccessConfigurationElement

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data;
namespace Artech.ApplicationBlock.Configuration
{
  public class DataAccessConfigurationElement:ConfigurationElement
  {
    /**//// <summary>
    /// The database namw which uniquely identifies the current database.
    /// </summary>
    [ConfigurationProperty("name", IsRequired = true)]
    public string DatabaseName
    {
      get
      {
        return this["name"] as string;
      }
      set
      {
        this["name"] = value;
      }
    }
    /**//// <summary>
    /// A string indicating the concrete database provider.
    /// </summary>
    [ConfigurationProperty("dbProvider", DefaultValue = "System.Data.SqlClient")]
    public string DbProvider
    {
      get
      {
        return this["dbProvider"] as string;
      }
      set
      {
        this["dbProvider"] = value;
      }
    }
    /**//// <summary>
    /// A string indicating the connection string to connect to the concrete database.
    /// </summary>
    [ConfigurationProperty("connectionString")]
    public string ConnectionString
    {
      get
      {
        return this["connectionString"] as string;
      }
      set
      {
        this["connectionString"] = value;
      }
    }
    /**//// <summary>
    /// A flag which determines if this is the default database.
    /// </summary>
    [ConfigurationProperty("isDefault", DefaultValue = false)]
    public bool IsDefaultDatabase
    {
      get
      {
        return (bool)this["isDefault"];
      }
      set
      {
        this["isDefault"] = value;
      }
    }
    /**//// <summary>
    /// A bool flag indicating if the default operation are all executed using command builder or stored procedure.
    /// </summary>
    [ConfigurationProperty("usingCommandBuilderToUpdate", DefaultValue = false)]
    public bool UsingCommandBuilderToUpdate
    {
      get
      {
        return (bool)this["usingCommandBuilderToUpdate"];
      }
      set
      {
        this["usingCommandBuilderToUpdate"] = value;
      }
    }
    /**//// <summary>
    /// A CommandType enumeration indicating if the default command type.
    /// </summary>
    [ConfigurationProperty("dedaultCommandType", DefaultValue = CommandType.StoredProcedure)]
    public CommandType DedaultCommandType
    {
      get
      {
        return (CommandType)this["dedaultCommandType"];
      }
      set
      {
        this["dedaultCommandType"] = value;
      }
    }
    /**//// <summary>
    /// A string indicating the type of the class to perform mapping between parameter and the source column name.
    /// </summary>
    [ConfigurationProperty("dbParameterNameMapping", DefaultValue = "Artech.ApplicationBlock.DataMapping.SimpleDbParameterNameMapping,Artech.ApplicationBlock.DataMapping")]
    public string DbParameterNameMapping
    {
      get
      {
        return this["dbParameterNameMapping"] as string;
      }
      set
      {
        this["dbParameterNameMapping"] = value;
      }
    }
    /**//// <summary>
    /// A string indicating the type of the class to perform mapping between the data table name and the name of stored procedures to perform insertion, modification and deletion operation.
    /// </summary>
    [ConfigurationProperty("storedProcedureNameMapping", DefaultValue = "Artech.ApplicationBlock.DataMapping.SimpleStoredProcedureNameMapping,Artech.ApplicationBlock.DataMapping")]
    public string StoredProcedureNameMapping
    {
      get
      {
        return this["storedProcedureNameMapping"] as string;
      }
      set
      {
        this["storedProcedureNameMapping"] = value;
      }
    }
  }
}

上一页  4 5 6 7 8 9 10  下一页

Tags:ORM 开发 自己

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接