[Solved] Get/Count Number of Entities? [closed]

Found it out. I have to use the contextobject: ERP_EMIModelContainer context = new ERP_EMIModelContainer(); and now I do this: int numberOfEntities = context.MetadataWorkspace.GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace).BaseEntitySets.Count; btw Thanks for downvoting the question … 2 solved Get/Count Number of Entities? [closed]

[Solved] How to write a Linq to entity statement, using sql not in operator [duplicate]

You can write something like that: var query = myEntities.Groupeusers .Where(gu => !myEntities.Utilisateur.Any(ut => ut.idgroupe == gu.idgroupe)).ToList(); That should work. EDIT: Try that query instead: var query = myEntities.Groupeusers .Where(gu => !myEntities.Utilisateur .SelectMany(ut=>ut.Groupeuser) .Any(gu => gu.Idgroupe == gu.Idgroupe)).ToList(); OR maybe even better: var query = myEntities.GroupeUsers .Except(myEntities.Utilisateur.SelectMany(ut => ut.Groupeuser)) .ToList(); EDIT2: If I understand your … Read more

[Solved] How to filter data based on maximum datetime value in each day [closed]

With data like: public class Data { public String Name { get; set; } public DateTime TimeStamp { get; set; } public Data(String name, DateTime timeStamp) { this.Name = name; this.TimeStamp = timeStamp; } public override string ToString() { return String.Format(“{0} at {1}”, this.Name, this.TimeStamp); } } You can use: var source = new Data[] … Read more