[英]How do I setup Entity Framework Core 2.1 with Sqlite? - Connecting Database to My Solution
I am not an expert on this technology yet, so I guess for most this is a very basic question... But I don't really know how to use DBContext and how can I really connect my database, to the cross-platform solution file... and which nuget packages should I use?... where do I reference it?... what classes should I make and what codes do I put in it?... These questions, that I don't even know how to apply on my solution, I hope it doesn't bother you guys... 我还不是该技术的专家,所以我想大多数情况下这是一个非常基本的问题……但是我真的不知道如何使用DBContext,以及如何真正将数据库连接到跨平台解决方案。文件...我应该使用哪个nuget包?...我在哪里引用它?...我应该制作什么类以及应在其中添加什么代码?...这些我什至没有的问题知道如何应用我的解决方案,希望它不会打扰你们...
My goal is to make a datagrid using xaml grid, binded with sqlite database using entity framework core 2.1... 我的目标是使用xaml网格制作一个数据网格,并使用实体框架核心2.1与sqlite数据库绑定...
If you can answer my question in a step-by-step guide that would be really helpful for me... 如果您可以按照分步指南回答我的问题,那对我真的很有帮助...
*How can I setup the Entity Framework Core 2.1 using the database that I created from sqlite? *如何使用从sqlite创建的数据库设置Entity Framework Core 2.1?
* My Database Location & Name: C:\sqlite\demo.db
* My Target Framework: .Net Standard 2.0
* My Visual Studio Version: 15.7.2
* For Android, IOS, & UWP
You can use the dotnet
command line tool: 您可以使用
dotnet
命令行工具:
dotnet ef dbcontext scaffold "Data Source=demo.db;" Microsoft.EntityFrameworkCore.Sqlite -OutputDir DataFolder -c "context name"
https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.