Example #1
0
        public async Task AddAsync(string name)
        {
            var area = new Area();

            area.ID   = Guid.NewGuid();
            area.Name = name;
            await _dbContext.Set <Area>().AddAsync(area);

            await _dbContext.SaveChangesAsync();
        }
Example #2
0
        public async Task <WasteControllerSummaryItem[]> GetSummaryAsync()
        {
            var areas = await _dbContext.Set <Area>().ToArrayAsync();

            return(areas.Select(x => new WasteControllerSummaryItem()
            {
                Area = x.Name,
            }).ToArray());
        }