public BusinessServices.Katalog[] GetGames() { using (var ctx = new KasynoContext()) { return(ctx.Katalog .ToArray() .Select(x => MapBusinessKatalogToKatalog(x)) .ToArray()); } }
public BusinessServices.OpisStanu[] GetState() { using (var ctx = new KasynoContext()) { return(ctx.OpisStanu .ToArray() .Select(x => MapBusinessStanToStan(x)) .ToArray()); } }
public void UpdateGame(BusinessServices.Katalog game) { using (var ctx = new KasynoContext()) { var record = ctx.Katalog.FirstOrDefault(x => x.NazwaGry == game.NazwaGry); if (record == null) { return; } record.OpisGry = game.OpisGry; ctx.SaveChanges(); } }
public void UpdateState(BusinessServices.OpisStanu state) { using (var ctx = new KasynoContext()) { var record = ctx.OpisStanu.FirstOrDefault(x => x.Id == state.Id); if (record == null) { return; } record.IloscGier = state.IloscGier; record.Stol = (ICollection <Stol>)state.NumerStolow; ctx.SaveChanges(); } }