Ejemplo n.º 1
0
        public int EditLocationById(int id, NSLocation_vm location)
        {
            if (id == 0)
            {
                throw new ArgumentOutOfRangeException("Id cannot be 0.");
            }

            return(_nsLocationRepository.EditLocationByID(id, mapViewModelToEntityLocation(location)));
        }
Ejemplo n.º 2
0
 private NSLocation mapViewModelToEntityLocation(NSLocation_vm VMLocation)
 {
     return(new NSLocation
     {
         Id = VMLocation.Id,
         LocationCity = VMLocation.LocationCity,
         LocationState = VMLocation.LocationState,
         LocationZip = VMLocation.LocationZip
     });
 }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
0
 public int CreateLocation(NSLocation_vm location)
 {
     return(_nsLocationRepository.CreateLocation(mapViewModelToEntityLocation(location)));
 }
Ejemplo n.º 5
0
 /// <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));
 }