public EntityTableProxy(EntityTable entityTable, IEntityTableSource entityTableSource = null)
 {
     LoadTable(entityTable, entityTableSource);
 }
 virtual public void LoadTable(EntityTable EntityTable, IEntityTableSource entityTableSource)
 {
     SourceProvider = entityTableSource;
     Table          = EntityTable;
 }
        static public bool TryGetTable <TEntity>(this IEntityTableSource it, out EntityTableProxy <TEntity> tableProxy, string ns, string tableName, params string[] keys)
        {
            var selectCond = new EntityRelation(ns, tableName, keys);

            return(it.TryGetTable(selectCond, out tableProxy));
        }
Esempio n. 4
0
 public EntityRowProxy(EntityRow row, IEntityTableSource sourceProvider)
 {
     Row                  = row;
     SourceProvider       = sourceProvider;
     Row.PropertyChanged += new PropertyChangedEventHandler(OnFieldValueChanged);
 }
Esempio n. 5
0
 static public TEntity GetEntity <TEntity>(this EntityRow dataRow, IEntityTableSource entityTableSource = null)
 {
     return(dataRow.GenProxy <TEntity>(entityTableSource).Entity);
 }
Esempio n. 6
0
        static public EntityRowProxy <TEntity> GenProxy <TEntity>(this EntityRow dataRow, IEntityTableSource entityTableSource = null)
        {
            string proxyKey = typeof(EntityRowProxy <TEntity>).FullName;
            EntityRowProxy <TEntity> proxy;

            if (!dataRow.TryGetCache(proxyKey, out proxy))
            {
                proxy = new EntityRowProxy <TEntity>(dataRow, entityTableSource);
                dataRow.AddCache(proxyKey, proxy);
            }
            return(proxy);
        }
Esempio n. 7
0
 static public EntityTableProxy <TEntity> GenProxy <TEntity>(this EntityTable table, IEntityTableSource entityTableSource = null)
 {
     return(new EntityTableProxy <TEntity>(table, entityTableSource));
 }