Skip to content

Commit 5445731

Browse files
author
Leonid
committed
Add plugin DbContext functionality
1 parent 614c7d5 commit 5445731

26 files changed

+311
-229
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.ComponentModel.DataAnnotations;
2+
using System.ComponentModel.DataAnnotations.Schema;
3+
4+
namespace EformBase.Pn.Infrastructure.Data.Base
5+
{
6+
public class BaseEntity
7+
{
8+
[Key]
9+
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
10+
public int Id { get; set; }
11+
}
12+
}

eFormAPI/eFormAPI/Infrastructure/Data/BaseDbContext.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/BaseDbContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Data.Entity;
2-
using eFormAPI.Web.Infrastructure.Data.Entities;
2+
using EformBase.Pn.Infrastructure.Data.Entities;
33
using Microsoft.AspNet.Identity.EntityFramework;
44

5-
namespace eFormAPI.Web.Infrastructure.Data
5+
namespace EformBase.Pn.Infrastructure.Data
66
{
77
public class BaseDbContext : IdentityDbContext<EformUser, EformRole,
88
int, EformUserLogin, EformUserRole, EformUserClaim>

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformRole.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformRole : IdentityRole<int, EformUserRole>
66
{

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformRoleStore.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformRoleStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformRoleStore : RoleStore<EformRole, int, EformUserRole>
66
{

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformUser.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformUser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.AspNet.Identity;
44
using Microsoft.AspNet.Identity.EntityFramework;
55

6-
namespace eFormAPI.Web.Infrastructure.Data.Entities
6+
namespace EformBase.Pn.Infrastructure.Data.Entities
77
{
88
public class EformUser : IdentityUser<int, EformUserLogin, EformUserRole,
99
EformUserClaim>

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformUserClaim.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformUserClaim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformUserClaim : IdentityUserClaim<int>
66
{

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformUserLogin.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformUserLogin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformUserLogin : IdentityUserLogin<int>
66
{

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformUserRole.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformUserRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformUserRole : IdentityUserRole<int>
66
{

eFormAPI/eFormAPI/Infrastructure/Data/Entities/EformUserStore.cs renamed to eFormAPI/EformBase.Pn/Infrastructure/Data/Entities/EformUserStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNet.Identity.EntityFramework;
22

3-
namespace eFormAPI.Web.Infrastructure.Data.Entities
3+
namespace EformBase.Pn.Infrastructure.Data.Entities
44
{
55
public class EformUserStore : UserStore<EformUser, EformRole, int,
66
EformUserLogin, EformUserRole, EformUserClaim>

eFormAPI/EformBase.Pn/eFormApi.BasePn.csproj

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@
7070
<Reference Include="EPPlus, Version=4.5.2.1, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
7171
<HintPath>..\packages\EPPlus.4.5.2.1\lib\net40\EPPlus.dll</HintPath>
7272
</Reference>
73+
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74+
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
75+
</Reference>
76+
<Reference Include="Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
77+
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
78+
</Reference>
79+
<Reference Include="Microsoft.AspNet.Identity.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<HintPath>..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
81+
</Reference>
82+
<Reference Include="Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
83+
<HintPath>..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
84+
</Reference>
85+
<Reference Include="Microsoft.Owin.Security, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86+
<HintPath>..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath>
87+
</Reference>
88+
<Reference Include="Microsoft.Owin.Security.Cookies, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
89+
<HintPath>..\packages\Microsoft.Owin.Security.Cookies.2.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll</HintPath>
90+
</Reference>
91+
<Reference Include="Microsoft.Owin.Security.OAuth, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
92+
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.2.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
93+
</Reference>
7394
<Reference Include="Microting.eForm, Version=2.1.280.0, Culture=neutral, processorArchitecture=MSIL">
7495
<HintPath>..\packages\Microting.eForm.2.1.280\lib\net45\Microting.eForm.dll</HintPath>
7596
</Reference>
@@ -83,7 +104,10 @@
83104
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
84105
</Reference>
85106
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
86-
<HintPath>..\packages\NLog.4.3.11\lib\net45\NLog.dll</HintPath>
107+
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
108+
</Reference>
109+
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
110+
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
87111
</Reference>
88112
<Reference Include="PresentationCore" />
89113
<Reference Include="Rebus, Version=4.2.1.0, Culture=neutral, processorArchitecture=MSIL">
@@ -100,11 +124,14 @@
100124
<Reference Include="System.Configuration" />
101125
<Reference Include="System.Core" />
102126
<Reference Include="System.Drawing" />
127+
<Reference Include="System.IO.Compression" />
103128
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
104129
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
105130
</Reference>
106131
<Reference Include="System.Runtime.Remoting" />
132+
<Reference Include="System.Runtime.Serialization" />
107133
<Reference Include="System.Security" />
134+
<Reference Include="System.ServiceModel" />
108135
<Reference Include="System.Transactions" />
109136
<Reference Include="System.Web" />
110137
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -120,6 +147,15 @@
120147
<ItemGroup>
121148
<Compile Include="Consts\EformRoles.cs" />
122149
<Compile Include="Helpers\LocaleHelper.cs" />
150+
<Compile Include="Infrastructure\Data\BaseDbContext.cs" />
151+
<Compile Include="Infrastructure\Data\Base\BaseEntity.cs" />
152+
<Compile Include="Infrastructure\Data\Entities\EformRole.cs" />
153+
<Compile Include="Infrastructure\Data\Entities\EformRoleStore.cs" />
154+
<Compile Include="Infrastructure\Data\Entities\EformUser.cs" />
155+
<Compile Include="Infrastructure\Data\Entities\EformUserClaim.cs" />
156+
<Compile Include="Infrastructure\Data\Entities\EformUserLogin.cs" />
157+
<Compile Include="Infrastructure\Data\Entities\EformUserRole.cs" />
158+
<Compile Include="Infrastructure\Data\Entities\EformUserStore.cs" />
123159
<Compile Include="Infrastructure\Handlers\GenerateJasperFilesHandler.cs" />
124160
<Compile Include="Infrastructure\EFormCoreHelper.cs" />
125161
<Compile Include="Infrastructure\Installers\RebusInstaller.cs" />

0 commit comments

Comments
 (0)