Example #1
0
        public List <Pais> All()
        {
            List <Pais> listPais = null;

            using (var ctx = new  PruebaXMSEntities())
            {
                listPais = ctx.Pais.ToList().Select(c => MapFromDataSourceToEntity(c)).ToList();
            }

            return(listPais);
        }
Example #2
0
 public List <Usuario> All()
 {
     try
     {
         using (var ctx = new PruebaXMSEntities())
         {
             return(new UsuarioRepository(ctx).All());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
 public void Delete(ref Usuario entity)
 {
     try
     {
         using (var ctx = new PruebaXMSEntities())
         {
             var asociadoRepository = new UsuarioRepository(ctx);
             asociadoRepository.Delete(entity);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
        public void Create(ref Usuario entity)
        {
            try
            {
                using (var ctx = new PruebaXMSEntities())
                {
                    var asociadoRepository = new UsuarioRepository(ctx);

                    entity.Password = Encriptar(entity.Password);

                    asociadoRepository.Insert(ref entity);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
0
 public UsuarioRepository(PruebaXMSEntities _dbContext) : base(_dbContext)
 {
 }
Example #6
0
 public BaseRepository(PruebaXMSEntities _dbContext)
 {
     dbContext = _dbContext;
 }