Example #1
0
 public BusinessServices.Katalog[] GetGames()
 {
     using (var ctx = new KasynoContext())
     {
         return(ctx.Katalog
                .ToArray()
                .Select(x => MapBusinessKatalogToKatalog(x))
                .ToArray());
     }
 }
Example #2
0
 public BusinessServices.OpisStanu[] GetState()
 {
     using (var ctx = new KasynoContext())
     {
         return(ctx.OpisStanu
                .ToArray()
                .Select(x => MapBusinessStanToStan(x))
                .ToArray());
     }
 }
Example #3
0
        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();
            }
        }
Example #4
0
        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();
            }
        }