Ejemplo n.º 1
0
        public List<AdressModel> BindFromEntitiesBy(int id)
        {

            using (RepositoryHolder scope = new RepositoryHolder())
            {
                AdressMapper mapper = new AdressMapper();
                //CurrencyRateMapper mapper2 = new CurrencyRateMapper();   
                List<AdressModel> result = mapper.EntityToModel(
                    scope.AdressRepository
                    .FetchBy(p => p.cIdBank == id)
                   .ToList());
                return result;
            }

        }
Ejemplo n.º 2
0
        public List<AdressModel> BindFromEntities()
        {
            using (RepositoryHolder scope = new RepositoryHolder())
            {
                AdressMapper mapper = new AdressMapper();
                
                List<AdressModel> result =  //mapper.EntityToModel(
                    scope.AdressRepository
                    .Fetch()
                    .Select
                        (
                            p => 
                                mapper.EntityToModel(p)
                        )
                   .ToList();
                return result;
            }

        }
Ejemplo n.º 3
0
        public List<AdressModel> BindFromEntities(string city, string country)
        {
            using (RepositoryHolder scope = new RepositoryHolder())
            {
                AdressMapper mapper = new AdressMapper();

                List<AdressModel> result = mapper.EntityToModel(
                    scope.AdressRepository
                    .FetchBy(p =>p.cCity==city)

                   .ToList());
                /*
                if (result == null)
                {
                    return GetData(city, country);
                }
                else
                {
                    return result;
                }*/
                return result;
            }

        }