ORM: 开发自己的Data Access Application Block - Part I
2008-12-06 10:15:45 来源:WEB开发网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;
}
}
}
}
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››开发者眼中的Windows Phone和Android
- ››开发学院教你用SQL 语句最快速清空MySQL 数据表的...
- ››自己动手写iPhone wap浏览器之界面架构篇
- ››自己也能DIY个性真人QQ表情
- ››自己动手!巧法让酷狗动感歌词更完美
- ››自己编译Google Android内核的Linux源码
- ››自己写的一个jquery模板引擎(json比较好用)
- ››开发一个自己的HTML在线编辑器(一)
- ››开发一个自己的HTML在线编辑器(二)
更多精彩
赞助商链接