protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AutoMapperConfig.ConfigureMapper(); }
public List<CountryVM> Get() { List<CountryVM> retval = null; retval = AutoMapperConfig.ConfigureMapper() .Map<List<CountryEntity>, List<CountryVM>>(DummyDataHelper.DBCountries); return retval; }
protected void Application_Start() { AutoMapperConfig.ConfigureMapper(); IKernel kernel = new StandardKernel(new ServicesModule()); DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel)); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
public List <PersonVM> Get() { List <PersonVM> retval = null; retval = AutoMapperConfig.ConfigureMapper() .Map <List <PersonEntity>, List <PersonVM> >(DummyDataHelper.DBPeople); return(retval); }
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; }
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); }
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; }
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); }
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); }
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; }
public void Configuration(IAppBuilder app) { AutofacConfig.ConfigureContainer(app); AutoMapperConfig.ConfigureMapper(); }