public async Task<ContactItem> GetContactForBuilding(BuildingItem buildingItem) { MRModel context = new MRModel(); var toReturn = await (from item in context.ContactItems where item.id == buildingItem.Owner.id select item).SingleOrDefaultAsync(); return toReturn; }
public async Task<IEnumerable<BuildingItem>> GetAllBuildings() { MRModel context = new MRModel(); var toReturn = await (from item in context.BuildingItems orderby item.BuildYear descending select item).ToListAsync(); return toReturn; }
public async Task <ContactItem> GetContactForBuilding(BuildingItem buildingItem) { MRModel context = new MRModel(); var toReturn = await(from item in context.ContactItems where item.id == buildingItem.Owner.id select item).SingleOrDefaultAsync(); return(toReturn); }
public async Task <IEnumerable <ContactItem> > GetAllContacts() { MRModel context = new MRModel(); var toReturn = await(from item in context.ContactItems orderby item.Lastname ascending select item).ToListAsync(); return(toReturn); }
public async Task<IEnumerable<ContactItem>> GetAllContacts() { MRModel context = new MRModel(); var toReturn = await (from item in context.ContactItems orderby item.Lastname ascending select item).ToListAsync(); return toReturn; }
public async Task <IEnumerable <BuildingItem> > GetAllBuildings() { MRModel context = new MRModel(); var toReturn = await(from item in context.BuildingItems orderby item.BuildYear descending select item).ToListAsync(); return(toReturn); }
public async Task<IEnumerable<MeterItem>> GetMetersForBuilding(Guid idBuilding) { MRModel context = new MRModel(); var toReturn = await (from item in context.MeterItems where item.BelongsTo.id.Equals(idBuilding) orderby item.MeterId ascending select item).ToListAsync(); return toReturn; }
public async Task <IEnumerable <MeterItem> > GetMetersForBuilding(Guid idBuilding) { MRModel context = new MRModel(); var toReturn = await(from item in context.MeterItems where item.BelongsTo.id.Equals(idBuilding) orderby item.MeterId ascending select item).ToListAsync(); return(toReturn); }
private void TestEntityButton_Click(object sender, EventArgs e) { MRModel context = new MRModel(); var result = from item in context.ContactItems select item; context.ContactItems.Add(new ContactItem { id = Guid.NewGuid(), Firstname = "Klaus", Lastname = "Löffelmann", Phone="+49 2941 910907" }); context.SaveChanges(); }