public Task <List <MswSurfSpot> > GetAllMswSurfSpotsAsync() { using var db = new SurfsUpDbContext(); return(db.MswSurfSpots.Select(s => s).ToListAsync()); }
public Task RemoveBafuSurfSpotAsync(BafuSurfSpot bafuSurfSpot) { using var db = new SurfsUpDbContext(); db.Remove(bafuSurfSpot); return(db.SaveChangesAsync()); }
public Task <BafuSurfSpot> GetBafuSurfSpotAsync(int id) { using var db = new SurfsUpDbContext(); return(db.BafuSurfSpots.Where(s => s.Id == id).FirstOrDefaultAsync()); }
public Task ChangeBafuSurfSpotAsync(BafuSurfSpot bafuSurfSpot) { using var db = new SurfsUpDbContext(); db.Attach(bafuSurfSpot).State = EntityState.Modified; return(db.SaveChangesAsync()); }
public Task RemoveMswSurfSpotAsync(MswSurfSpot mswSurfSpot) { using var db = new SurfsUpDbContext(); db.Remove(mswSurfSpot); return(db.SaveChangesAsync()); }