Exemple #1
0
 // This method gets called by the runtime. Use this method to add services to the
 //container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddDbContext <TodoContext>(opt =>
                                         opt.UseInMemoryDatabase("TodoList"));
     services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
     StaticService.GetData(Configuration.GetConnectionString("DefaultConnection"));
     services.Add(new ServiceDescriptor(typeof(CustomerService), new CustomerService()));
     services.Add(new ServiceDescriptor(typeof(CityService), new CityService()));
     services.Add(new ServiceDescriptor(typeof(PlaceService), new PlaceService()));
     services.Add(new ServiceDescriptor(typeof(CustomerPlaceService), new CustomerPlaceService()));
     //
 }