Inheritance: ITableInfo
Esempio n. 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");
 }
Esempio n. 2
0
 public PagedQueryBuilder(TableInfo info,IDbProvider provider)
 {
    
     _info = info;
     _provider = provider;
 
 }
Esempio n. 3
0
 public InsertSqlBuilder(TableInfo info,object data,IDbProvider provider,InsertSqlOptions options)
 {
     _info = info;
     _data = data;
     _provider = provider;
     _options = options;      
     options.EnsureTableName(info);      
 }
Esempio n. 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;
 });
Esempio n. 5
0
 public ColumnInfo(TableInfo table,PropertyInfo propertyInfo)
 {
     Table = table;
     PropertyInfo = propertyInfo;
     Name = propertyInfo.Name;
     IsComplex = Type!=typeof(object) && Type.IsUserDefinedClass();
 //    IsNullable = Type.IsNullable();
     
 }
Esempio n. 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;
     }
 }
Esempio n. 7
0
 public void EnsureTableName(TableInfo info)
 {
     if (TableName.IsNullOrEmpty()) TableName = info.Table.Name;
     if (DbSchema.IsNullOrEmpty()) DbSchema = info.Table.Schema;
 }
Esempio n. 8
0
 public TableInfoTests()
 {
     LogManager.OutputToConsole();
     _manageConverters = A.Fake<IManageConverters>();
     _sut = new TableInfo(typeof(MapperPost), _manageConverters);
 }
Esempio n. 9
0
 public void Add(TableInfo info)
 {
     _cache[info.Type] = info;
     info.Converter = _converter;
  }