Beispiel #1
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;
     }
 }
Beispiel #2
0
        public HashSet <PuntajeDTO> GetAll(int JuegoId)
        {
            HashSet <PuntajeDTO> puntajes = new HashSet <PuntajeDTO>();

            using (ModelosDBContainer context = new ModelosDBContainer())
            {
                PuntajeRepository repositorio = new PuntajeRepository(context);
                var entities = repositorio.GetAll(JuegoId);

                foreach (var entity in entities)
                {
                    puntajes.Add(this._mapper.Map <PuntajeDTO>(entity));
                }
            }
            return(puntajes);
        }