public IHttpActionResult UpdateFacts(int id, [FromBody] EventFactModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var userId = User.Identity.GetUserId <int>(); return(Ok(_eventService.UpdateFacts(model, userId))); }
/// <see cref="IEventService.UpdateFacts(EventFactModel, int)"/> public int UpdateFacts(EventFactModel model, int userId) { var res = _eventRepository.UpdateEventFact(new EventFact { Id = model.Id, id_Event = model.id_Event, id_FactType = model.id_FactType, FactText = model.FactText, Status = model.Status, Source = model.Source }, userId); return(res?.Id ?? -1); }