Exemple #1
0
        public TableResolver CreateObject(params object[] args)
        {
            IDbDataSource source  = ObjectUtil.ConfirmQueryObject <IDbDataSource>(this, args);
            TkDbContext   context = string.IsNullOrEmpty(Context) ? DbContextUtil.CreateDefault()
                : DbContextUtil.CreateDbContext(Context);

            using (context)
            {
                var scheme   = DbUtil.CreateSqlTableScheme(Sql, TableName, KeyFields, context);
                var schemeEx = MetaDataUtil.ConvertToTableSchemeEx(scheme);
                return(new SqlTableResolver(Sql, schemeEx, source));
            }
        }