public IEntityDefinition GetEntityDefinition(IEntityKey key) { IEntityDefinition entityDefinition; TryGetEntityDefinition(key, out entityDefinition); return(entityDefinition); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var comp = key as AssetKey; if (comp != null && Components != null) Components.Remove(comp); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var entity = key as EntityKey; if(ChildAssetsOrTypes == null || entity == null) return; ChildAssetsOrTypes.Remove(entity); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var space = key as SpaceKey; if(space == null || Spaces == null) return; Spaces.Remove(space); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var space = key as SpaceKey; if (space != null && Spaces != null) Spaces.Remove(space); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var contact = key as ContactKey; if (contact != null && Suppliers != null) Suppliers.Remove(contact); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (ApprovalBy == key) { ApprovalBy = null; } }
public static TEntity SaveEntity <TEntity>(IEntityKey t, ref IMDResponse res) where TEntity : class, IBaseEntity { UnitWork uw = new UnitWork(); var x = uw.Command <TEntity>().MapAndSave(t, ref res); uw.Save(ref res); return(x); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (ConnectedTo == key) ConnectedTo = null; if (RealizingElement == key) RealizingElement = null; }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (Owner == key) Owner = null; if (IssueWith == key) IssueWith = null; }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var comp = key as AssetKey; if (comp != null && Components != null) { Components.Remove(comp); } }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var contact = key as ContactKey; if (contact != null && Suppliers != null) { Suppliers.Remove(contact); } }
bool IEntityDefinitionProvider.TryGetEntityDefinition(IEntityKey entityKey, out IEntityDefinition entityDefinition) { if (entityKey is ENTITY_KEY) { return(TryGetEntityDefinition((ENTITY_KEY)entityKey, out entityDefinition)); } entityDefinition = null; return(false); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var space = key as SpaceKey; if (space != null && Spaces != null) { Spaces.Remove(space); } }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var job = key as JobKey; if (job != null && Priors != null) Priors.Remove(job); var res = key as ResourceKey; if (res != null && Resources != null) Resources.Remove(res); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var space = key as SpaceKey; if (space == null || Spaces == null) { return; } Spaces.Remove(space); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (Manufacturer == key) Manufacturer = null; if(Warranty == null) return; if (Warranty.GuarantorLabor == key) Warranty.GuarantorLabor = null; if (Warranty.GuarantorParts == key) Warranty.GuarantorParts = null; }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var entity = key as EntityKey; if (ChildAssetsOrTypes == null || entity == null) { return; } ChildAssetsOrTypes.Remove(entity); }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (ConnectedTo == key) { ConnectedTo = null; } if (RealizingElement == key) { RealizingElement = null; } }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (Owner == key) { Owner = null; } if (IssueWith == key) { IssueWith = null; } }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); var job = key as JobKey; if (job != null && Priors != null) { Priors.Remove(job); } var res = key as ResourceKey; if (res != null && Resources != null) { Resources.Remove(res); } }
public static List <T> ManyToMany <TEntity, T>(UnitWork uw, IEntityKey vm, Expression <Func <TEntity, object> > include, List <long> ids, ref IMDResponse res) where TEntity : class, IBaseEntity where T : class, IBaseEntity { var x = new List <T>(); Func <TEntity, object> func = include.Compile(); var ent = uw.QueryEntity <TEntity>().GetByID(vm.Id, false, include); if (ent != null && func(ent) != null) { (func(ent) as ICollection <T>).Clear(); uw.Command <TEntity>().Update(ent, ref res); } if (ids != null) { x.AddRange(uw.QueryEntity <T>().GetByIDs(ids.ToArray())); } return(x); }
public async Task <T> GetAsync(IEntityKey key) { try { var response = await Container.ReadItemAsync <T>(key.Id, new PartitionKey(key.PartitionKey)); var rus = response.RequestCharge; var statusCode = response.StatusCode; TrackRequestCharge($"GetAsync: {statusCode}", rus, key.PartitionKey); return(response.Resource); } catch (CosmosException cex) { if (cex.StatusCode == System.Net.HttpStatusCode.NotFound) { return(null); } throw; } }
internal override void RemoveKey(IEntityKey key) { base.RemoveKey(key); if (Manufacturer == key) { Manufacturer = null; } if (Warranty == null) { return; } if (Warranty.GuarantorLabor == key) { Warranty.GuarantorLabor = null; } if (Warranty.GuarantorParts == key) { Warranty.GuarantorParts = null; } }
private async ValueTask <T> GetWithDetails(IEntityKey <T> key, ReadConsistency consistency) { return(await WithDetailsSingle(consistency).FirstOrDefaultAsync(key.GetFilter())); }
/// <summary> /// Gets an entity by the primary key. /// </summary> /// <param name="key">The key for the entity.</param> /// <returns> /// An instance of the entity or null if not found. /// </returns> /// <remarks> /// This method provides a common retrieval of an entity. /// </remarks> /// <exception cref="NotImplementedException"></exception> public virtual TEntity GetByKey(IEntityKey key) { throw new NotImplementedException(); }
public bool TryGetEntry <TEntity>(IEntityKey key, out MapperContextEntry entry) { return(_entries.TryGetValue(new MapperContextKey(typeof(TEntity), key), out entry)); }
public static EntityFetchExpression AllFieldsExpression(IEntityKey entityKey) { return(new AllFieldsFetchExpression(entityKey)); }
protected EntityFetchExpression(IEntityKey entityKey) { _entityKey = entityKey; }
public async ValueTask Remove(IEntityKey <T> key) { var item = await _context.FindAsync <T>(key.GetValues()); Remove(item); }
public bool TryGetEntityDefinition(IEntityKey key, out IEntityDefinition value) { return(_entityDefinitions.TryGetValue(key, out value)); }
public StringEntityFetchExpression(ICollection <string> fields, IEntityKey entityKey) : base(entityKey) { _fields = fields; }
public void Add(IEntityKey entityKey, IEntityDefinition entityDefinition) { _entityDefinitions.Add(entityKey, entityDefinition); }
public bool Equals(IEntityKey key) { NamedKey namedKey = key as NamedKey; return(namedKey != null && string.Equals(_name, namedKey.Name, StringComparison.CurrentCultureIgnoreCase)); }
public abstract bool Equals(IEntityKey key);
public bool Equals(IEntityKey key) { var reflectedEntityKey = key as ReflectedEntityKey; return(reflectedEntityKey != null && reflectedEntityKey._entityType == _entityType); }
IEntityDefinition IEntityDefinitionProvider.GetEntityDefinition(IEntityKey entityKey) { return(GetEntityDefinition((ENTITY_KEY)entityKey)); }
public AllFieldsFetchExpression(IEntityKey entityKey) : base(entityKey) { }