예제 #1
0
 public Object Post(PuntajeDTO puntaje)
 {
     try
     {
         BusinessLogic.Controllers.PuntajeController puntajeController = new BusinessLogic.Controllers.PuntajeController();
         puntajeController.Create(puntaje);
         return(new ResponseDTO(HttpStatusCode.Created, "Se ha creado el puntaje correctamente.", true));
     }
     catch (Exception e)
     {
         return(Content(HttpStatusCode.InternalServerError, new ResponseDTO(null, e.Message, false)));
     }
 }
예제 #2
0
 public void Create(PuntajeDTO puntaje)
 {
     try
     {
         using (ModelosDBContainer context = new ModelosDBContainer())
         {
             PuntajeRepository repositorio = new PuntajeRepository(context);
             repositorio.Create(this._mapper.Map <Puntaje>(puntaje));
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }