IFDbContext.cs 959 B

12345678910111213141516171819202122
  1. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
  2. using Microsoft.EntityFrameworkCore;
  3. namespace BO.AppServer.Web.Data
  4. {
  5. public class IFDbContext : IdentityDbContext
  6. {
  7. public IFDbContext(DbContextOptions options)
  8. : base(options)
  9. {
  10. }
  11. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  12. {
  13. if (!optionsBuilder.IsConfigured)
  14. {
  15. #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
  16. optionsBuilder.UseSqlServer("Server=(local);Database=BO_IF;Trusted_Connection=True;");
  17. }
  18. }
  19. }
  20. }