Exemplo n.º 1
0
        public void Delete(int id)
        {
            using (var db = new DbContext())
            {
                Entities.CarcassRevenue carcassRevenue = db.CarcassRevenue.Single(x => x.Id == id);

                db.CarcassRevenue.Remove(carcassRevenue);
                db.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public void Update(CarcassRevenueDto dto)
        {
            using (var db = new DbContext())
            {
                Entities.CarcassRevenue carcassRevenue = db.CarcassRevenue.Single(x => x.Id == dto.Id);

                carcassRevenue.HuntedGameId  = dto.HuntedGameId;
                carcassRevenue.Revenue       = dto.Revenue;
                carcassRevenue.CarcassWeight = dto.CarcassWeight;

                db.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public void Insert(CarcassRevenueDto dto)
        {
            var entity = new Entities.CarcassRevenue
            {
                HuntedGameId  = dto.HuntedGameId,
                Revenue       = dto.Revenue,
                CarcassWeight = dto.CarcassWeight
            };

            using (var db = new DbContext())
            {
                db.CarcassRevenue.Add(entity);
                db.SaveChanges();
            }
        }