Beispiel #1
0
        public void Delete(ModelVehicule entity)
        {
            var item = mockModelsList.FirstOrDefault(x => x.Id == entity.Id);

            if (item != null)
            {
                mockModelsList.Remove(item);
            }
        }
        public IActionResult Update(long id, [FromBody] ModelVehicule model)
        {
            var modelToUpdate = _modelService.Get(id);

            if (modelToUpdate is null)
            {
                return(NotFound());
            }
            // mapping
            modelToUpdate.Description = model.Description;
            modelToUpdate.Model       = model.Model;

            _modelService.Update(modelToUpdate);
            return(NoContent());
        }
 public IActionResult Insert([FromBody] ModelVehicule model)
 {
     _modelService.Insert(model);
     return(Ok(model));
 }
Beispiel #4
0
 public void Insert(ModelVehicule entity)
 {
     mockModelsList.Add(entity);
 }
 public void Delete(ModelVehicule model)
 {
     modelRepository.Delete(model);
 }
 public void Update(ModelVehicule model)
 {
     modelRepository.Update(model);
 }
 public void Insert(ModelVehicule model)
 {
     modelRepository.Insert(model);
 }