public DataViewRemote(DataAdapter dataAdapter, DataContext dataContext, MetadataCli.Metadata metadataCli) { this.entityTypeName = typeof(T).Name; this.dataAdapter = dataAdapter; this.dataContext = dataContext; this.metadataCli = metadataCli; }
public DataAdapter(string baseUrl, string apiUrl, MetadataCli.Metadata metadataCli) { this.client = new HttpClient(); this.client.BaseAddress = new Uri(baseUrl); this.client.DefaultRequestHeaders.Accept.Clear(); this.client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); this.apiUrl = apiUrl; this.metadataCli = metadataCli; }
public DataService(string baseUrl, string apiUrl, MetadataCli.Metadata metadataCli) : base(baseUrl, apiUrl, metadataCli) { this.From = new ServiceLocation <LocalViews, RemoteViews>() { Local = new LocalViews(this.DataContext), Remote = new RemoteViews(this.DataAdapter, this.DataContext, metadataCli) }; this.Operation = new ServiceOperation <ServiceFunctions, ServiceActions>() { Function = new ServiceFunctions(this.DataAdapter, this.DataContext), Action = new ServiceActions(this.DataAdapter, this.DataContext) }; }
public void Dispose() { // se va apela inainte de incetarea utilizarii obiectului // pentru a evita aparitia de memory leaks si a usura activitatea GC-ului foreach (var entitySet in this.entitySets) { var entitySetValue = entitySet.Value; entitySetValue.Dispose(); } this.entitySets = null; this.metadataCli = null; }
public void Detach() { this.entitySets = null; this.metadataCli = null; }
public void Attach(Dictionary <string, IEntitySet <IDerivedEntity> > entitySets, MetadataCli.Metadata metadataCli) { this.entitySets = entitySets; this.metadataCli = metadataCli; }
public DataContext(string @namespace, MetadataCli.Metadata metadataCli) { this.metadataCli = metadataCli; this.@namespace = @namespace; this.entitySets = new Dictionary <string, IEntitySet <IDerivedEntity> >(); }
protected DataServiceBase(string baseUrl, string apiUrl, MetadataCli.Metadata metadataCli) { this.DataAdapter = new DataAdapter(baseUrl, apiUrl, metadataCli); this.DataContext = new DataContext("Client.Modules.Utils.DAL", metadataCli); }
/* */ public static IEntitySet <IDerivedEntity> CreateEntitySet(string entityTypeName, Dictionary <string, IEntitySet <IDerivedEntity> > entitySets, string @namespace, MetadataCli.Metadata metadataCli) { var derivedEntityType = Type.GetType(@namespace + "." + entityTypeName); var d1 = typeof(EntitySet <>); var typeArgs = new Type[] { derivedEntityType }; var constructed = d1.MakeGenericType(typeArgs); var entitySet = Activator.CreateInstance(constructed, new object[] { derivedEntityType, entitySets, metadataCli }); return((IEntitySet <IDerivedEntity>)entitySet); }
public void Dispose() { this.DeleteAll(); this.entitySets = null; this.metadataCli = null; }
public EntitySet(Type derivedEntityType, Dictionary <string, IEntitySet <IDerivedEntity> > entitySets, MetadataCli.Metadata metadataCli) { this.derivedEntityType = derivedEntityType; this.entityTypeName = derivedEntityType.Name; this.entitySets = entitySets; this.metadataCli = metadataCli; this.key = metadataCli.EntityTypes[this.entityTypeName].Key; this.Items = new List <IDerivedEntity>(); }
public RemoteViews(DataAdapter dataAdapter, DataContext dataContext, MetadataCli.Metadata metadataCli) : base(dataAdapter, dataContext, metadataCli) { }