Inheritance: ITableInfo
Example #1
0
 public void name_from_attribute()
 {
     var sut=new TableInfo(typeof(Post),_manageConverters);
     sut.HandleAttributeOverride();
     sut.Table.Name.Should().Be("SomePost");
     sut.IdentityColumn.Should().Be("SomeId");
 }
Example #2
0
 public PagedQueryBuilder(TableInfo info,IDbProvider provider)
 {
    
     _info = info;
     _provider = provider;
 
 }
Example #3
0
 public InsertSqlBuilder(TableInfo info,object data,IDbProvider provider,InsertSqlOptions options)
 {
     _info = info;
     _data = data;
     _provider = provider;
     _options = options;      
     options.EnsureTableName(info);      
 }
Example #4
0
 public TableInfo GetInfo(Type pocoType) 
     => _cache.GetValueOrCreate(pocoType, () =>
 {
     var table = GetName(pocoType);
    var info= new TableInfo(pocoType, _converter,table);
 //    info.HandleAttributeOverride();
     return info;
 });
Example #5
0
 public ColumnInfo(TableInfo table,PropertyInfo propertyInfo)
 {
     Table = table;
     PropertyInfo = propertyInfo;
     Name = propertyInfo.Name;
     IsComplex = Type!=typeof(object) && Type.IsUserDefinedClass();
 //    IsNullable = Type.IsNullable();
     
 }
Example #6
0
 public void Update(TableInfo info)
 {
     if (TableName == null)
     {
         TableName = info.Table;
     }
     else
     {
         info.Table = TableName;
     }
    
     var auto = Columns.Find(d => d.IsIdentity);
     if (auto != null)
     {
         info.IdentityColumn = auto.PropertyName;
     }
 }
Example #7
0
 public void EnsureTableName(TableInfo info)
 {
     if (TableName.IsNullOrEmpty()) TableName = info.Table.Name;
     if (DbSchema.IsNullOrEmpty()) DbSchema = info.Table.Schema;
 }
Example #8
0
 public TableInfoTests()
 {
     LogManager.OutputToConsole();
     _manageConverters = A.Fake<IManageConverters>();
     _sut = new TableInfo(typeof(MapperPost), _manageConverters);
 }
Example #9
0
 public void Add(TableInfo info)
 {
     _cache[info.Type] = info;
     info.Converter = _converter;
  }