Beispiel #1
0
        public async Task <SitioWebCurso> Create(SitioWebCurso Obj)
        {
            try
            {
                var result = _ctx.SitioWebCurso.Add(Obj);
                await _ctx.SaveChangesAsync();

                return(result);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
Beispiel #2
0
                                                          [HttpPost][Authorize] public async Task <IHttpActionResult> Create(SitioWebCurso 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)); }
                                                          }