第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

DbContextBuilder 不包含 UseSqlite 的定義

DbContextBuilder 不包含 UseSqlite 的定義

C#
梵蒂岡之花 2022-01-09 15:09:01
我是 UWP 的新手,我正在嘗試設(shè)置我的項目以使用 SQLite 數(shù)據(jù)庫,我正在使用 Microsoft.EntityFrameworkCore.SQLite。當(dāng)我嘗試設(shè)置數(shù)據(jù)庫上下文時,我不斷收到此錯誤。DbContextOptionsBuilder 不包含 UseSqlite 的定義,并且找不到接受 DBcontextoptionsbuilder 類型的第一個參數(shù)的可訪問擴(kuò)展方法(您使用的是指令還是程序集引用)這是我的代碼using Microsoft.EntityFrameworkCore;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace BradamaInternationalSkill.Models{    /// <summary>    /// The Entity Framework Database Context.    /// </summary>    public class PersonContext : DbContext    {        internal DbSet<Person> People { get; set; }        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)        {            optionsBuilder.UseSqlite("Filename=People.db");        }        protected override void OnModelCreating(ModelBuilder modelBuilder)        {            // Make Id required.            modelBuilder.Entity<Person>()                .Property(p => p.Id)                .IsRequired();            // Make Name required.            modelBuilder.Entity<Person>()                .Property(p => p.Name)                .IsRequired();        }    }}
查看完整描述

1 回答

?
江戶川亂折騰

TA貢獻(xiàn)1851條經(jīng)驗 獲得超5個贊

我通過卸載 Nuget 包“Microsoft Entity Framework Core”并安裝“Entity.Framework.Core.Sqlite.Design”解決了這個問題。我不知道為什么它解決了這個問題,但錯誤消失了,我很高興,這才是最重要的。


查看完整回答
反對 回復(fù) 2022-01-09
  • 1 回答
  • 0 關(guān)注
  • 541 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號