public async Task <AutoresIndustrialExt> Create(AutoresIndustrialExt Obj) { try { var result = _ctx.AutoresIndustrialExt.Add(Obj); await _ctx.SaveChangesAsync(); return(result); } catch (Exception e) { throw new Exception(e.Message, e); } }
[Authorize] public async Task <IHttpActionResult> Create(AutoresIndustrialExt Obj) { try { log.Info(new MDCSet(this.ControllerContext.RouteData)); var result = await _repository.Create(Obj); return(Ok(result)); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }