Пример #1
0
 public void  CreateCommand(SimMaster sim)
 {
     if (sim == null)
     {
         throw new ArgumentNullException(nameof(sim));
     }
     sim.ATSN = GetATSNUId();
     _Context.SimMasters.Add(sim);
 }
Пример #2
0
        public ActionResult UpdateCommand(int id, SimMaster simupdatedto)
        {
            var SimModelRepo = _repository.GetSimById(id);

            if (SimModelRepo == null)
            {
                return(NotFound());
            }
            _mapper.Map(simupdatedto, SimModelRepo);
            _repository.UpdateCommand(SimModelRepo);
            _repository.SaveChanges();
            return(NoContent());
        }
Пример #3
0
 public ActionResult CreateCommand(SimMaster sim)
 {
     if (sim.Id == 0)
     {
         _repository.CreateCommand(sim);
         _repository.SaveChanges();
         return(CreatedAtRoute(nameof(GetSimById), new { id = sim.Id }, sim));
     }
     else
     {
         return(UpdateCommand(sim.Id, sim));
     }
 }
Пример #4
0
 public void UpdateCommand(SimMaster sim)
 {
     //Nothing
 }