/// <summary> /// Evaluates which records from "List() passed as parameter" are NOT found on the database. /// </summary> /// <param name="Entities"> Entities List() </param> /// <returns>Records from List() Parameter that are NOT found on the Database</returns> public virtual List <TEntity> NOTInDatabase(List <TEntity> Entities) { var Results = (from ents in Entities join db in context.Set <TEntity>() on ents.Name equals db.Name into DbResults where !DbResults.Any() select ents).GroupBy(e => e.Name).Select(e => e.First()).ToList(); return((List <TEntity>)Results); }
/// <summary> /// Evaluates which records from "List() passed as parameter" are NOT found on the database. /// </summary> /// <param name="Entities"> Entities List() </param> /// <returns>Records from List() Parameter that are NOT found on the Database</returns> public List <InstanceContent> NOTInDatabase(List <InstanceContent> Entities) { var Results = (from ents in Entities join db in context.InstanceContent on new { AttributeID = ents.AttributeID, InstanceID = ents.InstanceID } equals new { AttributeID = db.AttributeID, InstanceID = db.InstanceID } into DbResults where !DbResults.Any() select ents).Where(e => e.AttributeID > 0 && e.InstanceID > 0).ToList(); return((List <InstanceContent>)Results); }
/// <summary> /// Evaluates which records from "List() passed as parameter" are NOT found on the database. /// </summary> /// <param name="Entities"> Entities List() </param> /// <returns>Records from List() Parameter that are NOT found on the Database</returns> public override List <IOTag> NOTInDatabase(List <IOTag> Entities) { var Results = (from ents in Entities join db in context.Set <IOTag>() on new { Name = ents.Name, PLCName = ents.PLC.Name } equals new { Name = db.Name, PLCName = db.PLC.Name } into DbResults where !DbResults.Any() select ents).GroupBy(e => e.Name).Select(e => e.First()).ToList(); return((List <IOTag>)Results); }