public UbfDTO GetByKey(Guid key) { var ubf = _dbContext.Set <Ubf>() .First(u => u.Id == key); return(UbfDTOMapper.ToUbfDTO(ubf)); }
public Guid Create(UbfDTO entity) { var ubf = UbfDTOMapper.ToUbf(entity); _dbContext.Add(ubf); _dbContext.SaveChanges(); return(ubf.Id); }
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(); }