示例#1
0
        public IHttpActionResult UpdateConnection(int id, [FromBody] EventConnectionModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var userId = User.Identity.GetUserId <int>();

            return(Ok(_eventService.UpdateConnection(model, userId)));
        }
示例#2
0
        /// <see cref="IEventService.UpdateConnection(EventConnectionModel, int)"/>
        public int UpdateConnection(EventConnectionModel model, int userId)
        {
            var result = _eventRepository.SaveConnection(new EventConnection
            {
                Id                = model.Id,
                id_Person         = model.id_Person,
                id_ConnectionType = model.id_ConnectionType,
                id_Event          = model.id_Event,
                id_EventConnectTo = model.id_EventConnectTo,
                Description       = model.Description
            }, userId);

            return(result?.Id ?? -1);
        }