Exemplo n.º 1
0
        public async Task <Society> AddAsync(Society newEntity)
        {
            _context.Society.Attach(newEntity); // Do we need this?
            _context.ApplyStateChanges();
            await _context.SaveChangesAsync();

            return(newEntity);
        }
Exemplo n.º 2
0
        public async Task <Flat> AddAsync(Flat newEntity)
        {
            _context.Flat.Attach(newEntity); // Do we need this?
            _context.ApplyStateChanges();
            await _context.SaveChangesAsync();

            return(newEntity);
        }
Exemplo n.º 3
0
        public async Task <Building> AddAsync(Building newEntity)
        {
            _context.Building.Attach(newEntity); // Do we need this?
            _context.ApplyStateChanges();
            await _context.SaveChangesAsync();

            return(newEntity);
        }
Exemplo n.º 4
0
 public async Task <bool> SaveAsync()
 {
     return((await _context.SaveChangesAsync()) >= 0);
 }