/// <summary> /// Repository初始化 /// </summary> /// <param name="database">数据库读写访问对象</param> public RepositoryDatabase(Database.DatabaseHelper database) { if (database == null) { throw new ArgumentNullException("database"); } if (typeof(T) == typeof(DynamicEntity)) { throw new ArgumentException(string.Format("泛型T不能是{0}", typeof(DynamicEntity).FullName)); } _dbReader = database; _dbWriter = database; var accessor = Map.GetCheckedAccessor <T>(); dbMetaInfo = accessor.MetaInfo as IDbMetaInfo; metaInfo = accessor.MetaInfo; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionTranslator" /> class. /// </summary> /// <param name="meta"> /// The database metadata information /// </param> public ExceptionTranslator(IDbMetaInfo meta) { Meta = meta; }
public EntityFrameworkExceptionTranslator(IDbMetaInfo meta) : base(meta) { }