Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. public partial class CoreContext
  2. {
  3. public CoreContext(
  4. DbContextOptions<CoreContext> options,
  5. IUserService userService,
  6. IAuditRepository auditRepository
  7. ) : base(options) {...}
  8. }
  9.  
  10. public partial class CoreContext : DbContext
  11. {
  12. public CoreContext(DbContextOptions<CoreContext> options) : base(options) {}
  13. }
  14.  
  15. public class Program
  16. {
  17. public static void Main(string[] args)
  18. {
  19. BuildWebHost(args).Run();
  20. }
  21.  
  22. public static IWebHost BuildWebHost(string[] args) =>
  23. WebHost.CreateDefaultBuilder(args)
  24. .UseKestrel()
  25. .UseContentRoot(Directory.GetCurrentDirectory())
  26. .UseIISIntegration()
  27. .UseStartup<Startup>()
  28. .Build();
  29. }
  30.  
  31. public IServiceProvider ConfigureServices(IServiceCollection services)
  32. {
  33. ...
  34. services.AddDbContextPool<CoreContext>(options => options.UseSqlServer(absConnectionString));
  35. ...
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement