C#实现的数据库源代码
protected override IDataParameter CreateParameter(ColumnInfo columnInfo) { OracleType oracleType = this.ToOracleDbType(columnInfo.ColumnType); OracleParameter parameter = new OracleParameter(":", oracleType); parameter.SourceColumn = columnInfo.PropertyName; parameter .Value = DBNull.Value; return parameter; } private OracleType ToOracleDbType(Type type) { if (type.BaseType == typeof(Enum)) { type = Enum.GetUnderlyingType(type); } int index = Array.IndexOf(EntityCommandBuilder.Types, type); if (index < 0) { throw ExceptionManager.Sql_CanNotInferDbTypeFromType(type.FullName); } return DbTypes[index]; } .Value = DBNull.Value; return parameter; } private OracleType ToOracleDbType(Type type) { if (type.BaseType == typeof(Enum)) { type = Enum.GetUnderlyingType(type); } int index = Array.IndexOf(EntityCommandBuilder.Types, type); if (index < 0) { throw ExceptionManager.Sql_CanNotInferDbTypeFromType(type.FullName); } return DbTypes[index]; }
用户评论
还没有仔细看,貌似是一个ORM的访问框架?
好东西,很实用
好东西哦,下次继续学习
挺实用,谢谢分享