File tree Expand file tree Collapse file tree 6 files changed +3
-6
lines changed Expand file tree Collapse file tree 6 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 77 <ItemGroup >
88 <PackageReference Include =" DevExpress.Blazor" Version =" 23.1.3" />
99 <PackageReference Include =" Microsoft.EntityFrameworkCore" Version =" 7.0.4" />
10- <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer " Version =" 7.0.4" />
10+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite " Version =" 7.0.4" />
1111 <PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 7.0.4" >
1212 <PrivateAssets >all</PrivateAssets >
1313 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ public NorthwindContext() {}
99 public NorthwindContext ( DbContextOptions < NorthwindContext > options ) : base ( options ) { }
1010 public virtual DbSet < Employee > Employees { get ; set ; }
1111 protected override void OnConfiguring ( DbContextOptionsBuilder optionsBuilder ) {
12- if ( ! optionsBuilder . IsConfigured ) {
13- optionsBuilder . UseSqlServer ( "Server=.\\ sqlexpress;Database=Northwind;Integrated Security=true" ) ;
14- }
1512 }
1613 protected override void OnModelCreating ( ModelBuilder modelBuilder ) {
1714 modelBuilder . UseCollation ( "SQL_Latin1_General_CP1_CI_AS" ) ;
Original file line number Diff line number Diff line change 1515} ) ;
1616builder . Services . AddDbContextFactory < NorthwindContext > ( ( sp , options ) => {
1717 var env = sp . GetRequiredService < IWebHostEnvironment > ( ) ;
18- var dbPath = Path . Combine ( env . ContentRootPath , "Northwind.mdf " ) ;
19- options . UseSqlServer ( "Server=(localdb) \\ MSSQLLocalDB;Integrated Security=true;AttachDbFileName =" + dbPath ) ;
18+ var dbPath = Path . Combine ( env . ContentRootPath , "Northwind.db " ) ;
19+ options . UseSqlite ( "DataSource =" + dbPath ) ;
2020} ) ;
2121builder . WebHost . UseWebRoot ( "wwwroot" ) ;
2222builder . WebHost . UseStaticWebAssets ( ) ;
You can’t perform that action at this time.
0 commit comments