Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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;
        }
Ejemplo n.º 8
0
        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();
        }