public ACrust Update(ACrust updatedType)
        {
            DBCrust dBCrust = mapperCrust.Map(updatedType, context);

            context.SaveChanges();
            return(mapperCrust.Map(dBCrust));
        }
        public void Remove(int id)
        {
            DBCrust crust = context.DBCrusts.FirstOrDefault(crust => crust.ID == id);

            if (crust is not null)
            {
                context.Remove(crust);
                context.SaveChanges();
            }
        }
Beispiel #3
0
        public void Remove(Crust genericType)
        {
            DBCrust dBCrust = mapperCrust.Map(genericType);
            DBCrust crust   = context.DBCrusts.ToList().Find(crust => crust.CRUST == dBCrust.CRUST);

            if (crust is not null)
            {
                context.Remove(crust);
                context.SaveChanges();
            }
        }
Beispiel #4
0
        public void update(Crust existingType, Crust updatedType)
        {
            DBCrust dBCrust = mapperCrust.Map(existingType);
            DBCrust crust   = context.DBCrusts.ToList().Find(crust => crust.CRUST == dBCrust.CRUST);

            if (crust is not null)
            {
                DBCrust EntityMapped = mapperCrust.Map(updatedType);
                crust.CRUST = EntityMapped.CRUST;
                crust.Price = EntityMapped.Price;
                context.SaveChanges();
            }
        }
        public void Test_CrustMapping()
        {
            // arrange
            MapperCrust mapperCrust = new MapperCrust();
            var         sut         = new DBCrust();

            sut.CRUST = CRUSTS.DEEPDISH;

            // act
            var sut2   = mapperCrust.Map(sut);
            var actual = sut2;

            // assert
            Assert.True(actual.CRUST != CRUSTS.THIN);
        }