private void SetSchemeData(TableSchemeData schemaData) { fKeyFieldInfos = schemaData.KeyFieldInfos; fKeyFieldArray = schemaData.KeyFieldArray; Fields = schemaData.SelectFields; KeyCount = fKeyFieldInfos.Count; }
public static string GetSelectFields(this ITableScheme scheme, TkDbContext context) { TkDebug.AssertArgumentNull(scheme, "scheme", null); TableSchemeData data = TableSchemeData.Create(context, scheme); return(data.SelectFields); }
private TableSelector(ITableScheme scheme, IDbDataSource source, bool useCache) { TkDebug.AssertArgumentNull(scheme, nameof(scheme), null); TkDebug.AssertArgumentNull(source, nameof(source), null); fSourceScheme = fScheme = scheme; Source = source; Context = source.Context; HostDataSet = source.DataSet; fDataAdapter = Context.CreateDataAdapter(); TableSchemeData schemaData = useCache ? TableSchemeData.Create(Context, scheme) : new TableSchemeData(Context, scheme); SetSchemeData(schemaData); }
public virtual void ReadMetaData(ITableScheme metaData) { if (metaData == null) { if (fScheme != fSourceScheme) { fScheme = fSourceScheme; TableSchemeData data = TableSchemeData.Create(Context, fSourceScheme); SetSchemeData(data); OnMetaDataChanged(true, fScheme); } } else { if (fScheme != metaData) { fScheme = metaData; TableSchemeData data = new TableSchemeData(Context, fScheme); SetSchemeData(data); OnMetaDataChanged(false, fScheme); } } }