public int EditLocationById(int id, NSLocation_vm location) { if (id == 0) { throw new ArgumentOutOfRangeException("Id cannot be 0."); } return(_nsLocationRepository.EditLocationByID(id, mapViewModelToEntityLocation(location))); }
private NSLocation mapViewModelToEntityLocation(NSLocation_vm VMLocation) { return(new NSLocation { Id = VMLocation.Id, LocationCity = VMLocation.LocationCity, LocationState = VMLocation.LocationState, LocationZip = VMLocation.LocationZip }); }
/// <summary> /// Puts the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <param name="value">The value.</param> /// <returns></returns> public int Put(int id, [FromBody] NSLocation_vm value) { _logger.Info("Editing the location wiht id" + id); return(_nsLocationManager.EditLocationById(id, value)); }
public int CreateLocation(NSLocation_vm location) { return(_nsLocationRepository.CreateLocation(mapViewModelToEntityLocation(location))); }
/// <summary> /// Posts the specified value. /// </summary> /// <param name="value">The value.</param> /// <returns></returns> public int Post([FromBody] NSLocation_vm value) { _logger.Info("Adding a new location."); return(_nsLocationManager.CreateLocation(value)); }