第一步:引入必要的Nuget工具包:
第二部项目中,创建一个空数据库放到项目下,并且编辑配置web.conf, 添加连接字符串,与ef provider.
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="libraryManageConnectionString" connectionString="Data Source=.;Initial Catalog=libraryManage;Persist Security Info=True;User ID=sa;Password=_password1" providerName="System.Data.SqlClient" />
<add name="sqliteDB" connectionString="data source=App_Data\LMS.db" providerName="System.Data.SQLite.EF6" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<