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