SQLite -> MySQL
This commit is contained in:
parent
778e7b45f3
commit
ee363a2207
|
@ -24,6 +24,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Pomelo.EntityFrameworkCore.MySql;
|
||||
|
||||
namespace api
|
||||
{
|
||||
|
@ -46,7 +47,7 @@ namespace api
|
|||
services.AddScoped<IUsersRepository, UsersRepository>();
|
||||
|
||||
//define a connection string indicada em appsettings.json
|
||||
services.AddDbContext<DataContext>(x=>x.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
|
||||
services.AddDbContext<DataContext>(x=>x.UseMySql(Configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
IdentityBuilder builder = services.AddIdentityCore<User>(Options=>
|
||||
{
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\"/>
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1"/>
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -5,7 +5,7 @@
|
|||
},
|
||||
"ConnectionStrings":
|
||||
{
|
||||
"DefaultConnection":"Data Source= api.db"
|
||||
"DefaultConnection":"server=enei.zmiguel.me;port=3306;database=enei;uid=enei;password=ENEIMegaPassword!"
|
||||
|
||||
},
|
||||
"Logging": {
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue