Beispiel #1
0
        public Model.RuteSlike Insert(RuteSlikeInsertRequest request)
        {
            Database.RuteSlike entity = _mapper.Map <Database.RuteSlike>(request);

            _context.RuteSlike.Add(entity);
            _context.SaveChanges();

            return(_mapper.Map <Model.RuteSlike>(entity));
        }
Beispiel #2
0
 public bool Remove(int id)
 {
     Database.RuteSlike entity = _context.RuteSlike.Where(x => x.RuteSlikeId == id).FirstOrDefault();
     if (entity != null)
     {
         _context.RuteSlike.Remove(entity);
         _context.SaveChanges();
         return(true);
     }
     return(false);
 }
Beispiel #3
0
        public Model.RuteSlike Update(int id, RuteSlikeInsertRequest request)
        {
            Database.RuteSlike entity = _context.RuteSlike.Where(x => x.RuteSlikeId == id).FirstOrDefault();

            _context.RuteSlike.Attach(entity);
            _context.RuteSlike.Update(entity);

            entity = _mapper.Map(request, entity);

            _context.SaveChanges();

            return(_mapper.Map <Model.RuteSlike>(entity));
        }