Beispiel #1
0
        public static string Gen(ISQLContext sqlContext, Type t)
        {
            var sql = GetGenTblSql(t);

            sqlContext.ExecuteSQL(sql);

            return(sql);
        }
Beispiel #2
0
        /// <summary>
        /// 请先创建好数据库,然后依据程序集生成所有表
        /// </summary>
        /// <param name="assembly"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public static void Gen(Assembly assembly, ISQLContext context)
        {
            var types = assembly.GetTypes();

            foreach (var type in types)
            {
                var b = type.BaseType;
                if (b != null && b.FullName.Contains("BaseEntity"))
                {
                    GenTbl.Gen(context, type);
                }
            }
        }
Beispiel #3
0
        public static ICompositeQuery AsCompositeQuery(this ISQLContext context)
        {
            ICompositeQuery query = new CompositeQuery(context);

            return(query);
        }
Beispiel #4
0
 public CompositeQuery(ISQLContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public static string Gen <T>(ISQLContext sqlContext) where T : BaseEntity <T>, new()
 {
     return(Gen(sqlContext, typeof(T)));
 }
 public PlayerRepository(ISQLContext context) : base(context)
 {
 }
Beispiel #7
0
 public SqlServerQueryExecutor(ISQLContext provider, string tblName)
 {
     this.provider = provider;
     _tblName      = tblName;
 }
Beispiel #8
0
 protected BaseRepository(ISQLContext context)
 {
     _context = context;
     DbSet    = _context.GetCollection <TEntity>();
 }
 public UnitOfWork(ISQLContext context,
                   IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }