efcore icon indicating copy to clipboard operation
efcore copied to clipboard

UseSqlite function is missing on EntityFrameworkCore.SQLite latest update

Open yeasin90 opened this issue 10 years ago • 9 comments

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 avatar Jun 27 '16 19:06 yeasin90

@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 avatar Jun 27 '16 20:06 natemcmaster

@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 :)

yeasin90 avatar Jun 27 '16 20:06 yeasin90

I am getting the same... When doing this..

services.AddDbContext(options => options.UseSqlite("Data Source=beer.db")); //NOT available here

Its missing, but its on DbContextOptionsBuilder

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseSqlite("Data Source=beer.db"); //Available here
        base.OnConfiguring(optionsBuilder);
    }

Jetski5822 avatar Aug 05 '17 17:08 Jetski5822

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"));

Jetski5822 avatar Aug 05 '17 17:08 Jetski5822

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; }
}

}

j3enterprisesolution avatar Jun 09 '18 18:06 j3enterprisesolution

I got it Just install the Microsoft.EntityFrameworkCore.SQLite

j3enterprisesolution avatar Jun 09 '18 19:06 j3enterprisesolution

Thanks for your solution

indrael999 avatar Jul 06 '18 00:07 indrael999

Thank you for the solution

ObsaT avatar Sep 04 '19 08:09 ObsaT

Thank's man you save my project!

hdamasceno avatar Sep 20 '19 13:09 hdamasceno