public void CreateCommand(SimMaster sim) { if (sim == null) { throw new ArgumentNullException(nameof(sim)); } sim.ATSN = GetATSNUId(); _Context.SimMasters.Add(sim); }
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()); }
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)); } }
public void UpdateCommand(SimMaster sim) { //Nothing }