Exemplo n.º 1
0
        public ITableScheme CreateObject(params object[] args)
        {
            TkDbContext context = string.IsNullOrEmpty(Context) ? DbContextUtil.CreateDefault() :
                                  DbContextUtil.CreateDbContext(Context);

            using (context)
            {
                if (!string.IsNullOrEmpty(KeyFields) && !string.IsNullOrEmpty(Fields))
                {
                    return(DbUtil.CreateTableScheme(TableName, KeyFields, Fields, context));
                }
                else if (!string.IsNullOrEmpty(KeyFields))
                {
                    return(DbUtil.CreateTableScheme(TableName, KeyFields, context));
                }
                else
                {
                    return(DbUtil.CreateTableScheme(TableName, context));
                }
            }
        }