예제 #1
0
        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));
        }
예제 #2
0
        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));
        }