UseSqlite function is missing on EntityFrameworkCore.SQLite latest update
After taking update of EntityFrameworkCore.SQLite, I cannot find UseSqlite method
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Filename=Blogging.db");
}
Is there any new approach??
@yeasin90 this method has not changed since RC1. Can you provide more details to reproduce the issue? (e.g. EF Core version, operating system, Visual Studio version, compiler errors, exception messages, etc?)
@natemcmaster : Yes, i guess the problem is from my side, some VS update - 2 setup corruption may be hampering me. I am giving another try with all my fixes. I shall report if any error occurs for Entity FrameworkCore.SqLite
Thanks :)
I am getting the same... When doing this..
services.AddDbContext
Its missing, but its on DbContextOptionsBuilder
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Data Source=beer.db"); //Available here
base.OnConfiguring(optionsBuilder);
}
Okay, I have it working... It doesnt appear at first. Just type it out, and save. I think its Visual Studio being a pain in the..
final code:
services.AddDbContext
((oa) => oa.UseSqlite("Data Source=beer.db"));
Am having the same problem.
Am running VS 2017 on Windows 10 with EF Core
using J3Windows.Models; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Data.SQLite.EF6; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace J3Windows.Database { class DbConnect : DbContext { private static bool _created = false; public DbConnect() { if (!_created) { _created = true; Database.EnsureDeleted(); Database.EnsureCreated(); } } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionbuilder.UseSqlite(@"Data Source=d:\Sample.db"); }
public DbSet<Usermaster> Categories { get; set; }
}
}
I got it Just install the Microsoft.EntityFrameworkCore.SQLite
Thanks for your solution
Thank you for the solution
Thank's man you save my project!