public Model.Paket Insert(Model.Requests.PaketInsertRequest request) { var paket = _mapper.Map <Database.Paket>(request); _context.Paket.Add(paket); _context.SaveChanges(); return(_mapper.Map <Model.Paket>(paket)); }
public Model.Paket Update(int id, Model.Requests.PaketInsertRequest request) { var paket = _context.Paket.Find(id); _mapper.Map(request, paket); paket.Id = id; _context.SaveChanges(); return(_mapper.Map <Model.Paket>(paket)); }