protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     AutoMapperConfig.ConfigureMapper();
 }
示例#2
0
        public List<CountryVM> Get()
        {
            List<CountryVM> retval = null;

            retval = AutoMapperConfig.ConfigureMapper()
                .Map<List<CountryEntity>, List<CountryVM>>(DummyDataHelper.DBCountries);

            return retval;
        }
示例#3
0
        protected void Application_Start()
        {
            AutoMapperConfig.ConfigureMapper();
            IKernel kernel = new StandardKernel(new ServicesModule());

            DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
示例#4
0
        public List <PersonVM> Get()
        {
            List <PersonVM> retval = null;

            retval = AutoMapperConfig.ConfigureMapper()
                     .Map <List <PersonEntity>, List <PersonVM> >(DummyDataHelper.DBPeople);

            return(retval);
        }
示例#5
0
        public CountryVM Get(Guid id)
        {
            CountryVM retval = null;
            CountryEntity tempCountry = DummyDataHelper.DBCountries.Find(c => c.Country_Id == id);

            if (tempCountry != null)
            {
                retval = AutoMapperConfig.ConfigureMapper().Map<CountryEntity, CountryVM>(tempCountry);
            }

            return retval;
        }
示例#6
0
        public PersonVM Get(Guid id)
        {
            PersonVM     retval     = null;
            PersonEntity tempPerson = DummyDataHelper.DBPeople.Find(p => p.Person_Id == id);

            if (tempPerson != null)
            {
                retval = AutoMapperConfig.ConfigureMapper().Map <PersonEntity, PersonVM>(tempPerson);
            }

            return(retval);
        }
示例#7
0
        public CountryVM Add(CountryVM item)
        {
            CountryVM retval = null;

            if (DummyDataHelper.DBCountries.Find(c => c.Country_Id == item.Id) == null)
            {
                CountryEntity tempCountry = AutoMapperConfig.ConfigureMapper().Map<CountryVM, CountryEntity>(item);
                DummyDataHelper.DBCountries.Add(tempCountry);
            }

            retval = Get(item.Id);

            return retval;
        }
示例#8
0
        public PersonVM Update(PersonVM item)
        {
            PersonVM retval = null;
            int      index  = DummyDataHelper.DBPeople.FindIndex(c => c.Person_Id == item.Id);

            if (index >= 0)
            {
                DummyDataHelper.DBPeople[index] =
                    AutoMapperConfig.ConfigureMapper().Map <PersonVM, PersonEntity>(item);
            }

            retval = Get(item.Id);

            return(retval);
        }
示例#9
0
        public PersonVM Add(PersonVM item)
        {
            PersonVM retval = null;

            if (Get(item.Id) == null)
            {
                PersonEntity tempPerson = AutoMapperConfig.ConfigureMapper()
                                          .Map <PersonVM, PersonEntity>(item);
                DummyDataHelper.DBPeople.Add(tempPerson);
            }

            retval = Get(item.Id);

            return(retval);
        }
示例#10
0
        public CountryVM Update(CountryVM item)
        {
            CountryVM retval = null;

            int index = DummyDataHelper.DBCountries.FindIndex(c => c.Country_Id == item.Id);

            if (index >= 0)
            {
                DummyDataHelper.DBCountries[index] =
                    AutoMapperConfig.ConfigureMapper().Map<CountryVM, CountryEntity>(item);
            }

            retval = Get(item.Id);

            return retval;
        }
示例#11
0
 public void Configuration(IAppBuilder app)
 {
     AutofacConfig.ConfigureContainer(app);
     AutoMapperConfig.ConfigureMapper();
 }