Guest User

Untitled

a guest
Nov 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.Configuration;
  4. using Microsoft.Extensions.DependencyInjection;
  5. using Microsoft.EntityFrameworkCore;
  6.  
  7. namespace ExemploTableSplitting
  8. {
  9. public class Startup
  10. {
  11. public Startup(IConfiguration configuration)
  12. {
  13. Configuration = configuration;
  14. }
  15.  
  16. public IConfiguration Configuration { get; }
  17.  
  18. public void ConfigureServices(IServiceCollection services)
  19. {
  20. services.AddEntityFrameworkSqlServer()
  21. .AddDbContext<ExemploContext>(
  22. options => options.UseSqlServer(
  23. Configuration.GetConnectionString("BaseCotacoes")));
  24.  
  25. services.AddMvc();
  26. }
  27.  
  28. public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  29. {
  30. if (env.IsDevelopment())
  31. {
  32. app.UseDeveloperExceptionPage();
  33. }
  34.  
  35. app.UseMvc();
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment