Exemplo n.º 1
0
 public Person Update(long id, PersonUpdateOptions options)
 {
     var entity = _people
         .FirstOrDefault(p => p.Id == id);
     if (entity == null) return null;
     if (!string.IsNullOrEmpty(options.Last)) entity.Last = options.Last;
     if (!string.IsNullOrEmpty(options.First)) entity.First = options.First;
     JsonFileToList<Person>.Write(_filename, _people);
     return entity;
 }
Exemplo n.º 2
0
 public IHttpActionResult Put(long id, PersonUpdateOptions options)
 {
     var vm = _peopleRepository.Update(id, options);
     return Ok(vm);
 }