Example #1
0
        internal ICodeFirst ConfigEntity <T>(Action <TableFluent <T> > entity)
        {
            if (entity == null)
            {
                return(_orm.CodeFirst);
            }
            var type   = typeof(T);
            var table  = dicConfigEntity.GetOrAdd(type, new TableAttribute());
            var fluent = new TableFluent <T>(table);

            entity.Invoke(fluent);
            Utils.RemoveTableByEntity(type, this);             //remove cache
            return(_orm.CodeFirst);
        }
 internal HasManyFluent(IFreeSql fsql, TableFluent <T> modelBuilder, string manyProperty)
 {
     _fsql         = fsql;
     _tf           = modelBuilder;
     _selfProperty = manyProperty;
 }
 internal HasOneFluent(IFreeSql fsql, TableFluent <T> modelBuilder, string oneProperty)
 {
     _fsql         = fsql;
     _tf           = modelBuilder;
     _selfProperty = oneProperty;
 }
 internal EfCoreTableFluent(IFreeSql fsql, TableFluent <T> tf)
 {
     _fsql = fsql;
     _tf   = tf;
 }
 internal HasIndexFluent(TableFluent <T> modelBuilder, string indexName, List <string> columns)
 {
     _modelBuilder = modelBuilder;
     _indexName    = indexName;
     _columns      = columns;
 }
Example #6
0
 internal HasManyFluent(TableFluent <T> modelBuilder, string manyProperty)
 {
     _tf           = modelBuilder;
     _selfProperty = manyProperty;
 }
Example #7
0
 internal HasOneFluent(TableFluent <T> modelBuilder, string oneProperty)
 {
     _tf           = modelBuilder;
     _selfProperty = oneProperty;
 }
Example #8
0
 internal EfCoreTableFluent(TableFluent <T> tf)
 {
     _tf = tf;
 }
Example #9
0
 internal EfCoreTableFluent(IFreeSql fsql, TableFluent tf, Type entityType)
 {
     _fsql       = fsql;
     _tf         = tf;
     _entityType = entityType;
 }