public UserCurrentlyReading UpdateUserCurrentlyReading(UserCurrentlyReading existing, UserCurrentlyReading UserCurrentlyReading) { _repositoryWrapper.UserCurrentlyReading.UpdateUserCurrentlyReading(existing, UserCurrentlyReading); // _logger.WriteInfo($"Updated user with id: {user.Id}."); return(UserCurrentlyReading); }
public UserCurrentlyReading AddUserCurrentlyReading(UserCurrentlyReading UserCurrentlyReading) { _repositoryWrapper.UserCurrentlyReading.AddUserCurrentlyReading(UserCurrentlyReading); //_logger.WriteInfo($"Added user with id: {user.Id}."); return(UserCurrentlyReading); }
public ActionResult Post([FromBody] UserCurrentlyReading newItem) { if (newItem is null) { return(BadRequest()); } var item = _UserCurrentlyReadingService.AddUserCurrentlyReading(newItem); return(Ok(item)); }
public ActionResult Put([FromBody] UserCurrentlyReading changedItem) { if (changedItem is null) { return(BadRequest()); } var existingItem = _UserCurrentlyReadingService.AsQueryable() .Where(x => x.Id == changedItem.Id) .FirstOrDefault(); if (existingItem is null) { return(NotFound()); } var item = _UserCurrentlyReadingService.UpdateUserCurrentlyReading(existingItem, changedItem); return(Ok(item)); }
public void RemoveUserCurrentlyReading(UserCurrentlyReading UserCurrentlyReading) { _repositoryWrapper.UserCurrentlyReading.RemoveUserCurrentlyReading(UserCurrentlyReading); // _logger.WriteInfo($"Removed user with id: {user.Id}."); }