Esempio n. 1
0
        public UbfDTO GetByKey(Guid key)
        {
            var ubf = _dbContext.Set <Ubf>()
                      .First(u => u.Id == key);

            return(UbfDTOMapper.ToUbfDTO(ubf));
        }
Esempio n. 2
0
        public Guid Create(UbfDTO entity)
        {
            var ubf = UbfDTOMapper.ToUbf(entity);

            _dbContext.Add(ubf);
            _dbContext.SaveChanges();
            return(ubf.Id);
        }
Esempio n. 3
0
        public void Update(UbfDTO entity)
        {
            var ubf = UbfDTOMapper.ToUbf(entity);

            var entry = _dbContext.Set <Ubf>()
                        .First(u => u.Id == ubf.Id);

            entry.ProducerId = ubf.ProducerId;
            entry.Status     = ubf.Status;

            _dbContext.SaveChanges();
        }