Revize 678af8f3
Přidáno uživatelem Dominik Chlouba před téměř 4 roky(ů)
Leuze.sln | ||
---|---|---|
35 | 35 |
EndProject |
36 | 36 |
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Leuze.Tests.Core.Domain", "tests\Core\Leuze.Tests.Core.Domain\Leuze.Tests.Core.Domain.csproj", "{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}" |
37 | 37 |
EndProject |
38 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Leuze.Core.Infrastructure.ActiveDirectory", "src\Core\Infrastructure\Leuze.Core.Infrastructure.ActiveDirectory\Leuze.Core.Infrastructure.ActiveDirectory.csproj", "{1407144F-48F6-404E-A890-961B739D030D}" |
|
39 |
EndProject |
|
40 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Leuze.Tests.Core.Infrastructure.ActiveDirectory", "tests\Core\Leuze.Tests.Core.Infrastructure.ActiveDirectory\Leuze.Tests.Core.Infrastructure.ActiveDirectory.csproj", "{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}" |
|
41 |
EndProject |
|
38 | 42 |
Global |
39 | 43 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
40 | 44 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
73 | 77 |
{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU |
74 | 78 |
{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU |
75 | 79 |
{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.Build.0 = Release|Any CPU |
80 |
{1407144F-48F6-404E-A890-961B739D030D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
81 |
{1407144F-48F6-404E-A890-961B739D030D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
82 |
{1407144F-48F6-404E-A890-961B739D030D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
83 |
{1407144F-48F6-404E-A890-961B739D030D}.Release|Any CPU.Build.0 = Release|Any CPU |
|
84 |
{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
85 |
{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
86 |
{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
87 |
{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Release|Any CPU.Build.0 = Release|Any CPU |
|
76 | 88 |
EndGlobalSection |
77 | 89 |
GlobalSection(SolutionProperties) = preSolution |
78 | 90 |
HideSolutionNode = FALSE |
... | ... | |
90 | 102 |
{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF} = {C5588326-929D-42B3-912B-9D838373B48E} |
91 | 103 |
{B74BED5E-F175-4A6E-B4AC-8625E0E4E287} = {C5588326-929D-42B3-912B-9D838373B48E} |
92 | 104 |
{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E} = {B74BED5E-F175-4A6E-B4AC-8625E0E4E287} |
105 |
{1407144F-48F6-404E-A890-961B739D030D} = {6A0F1F61-D0EB-4132-B722-5787D7046CC0} |
|
106 |
{C1813611-5FF2-4E70-B7E5-A4E8553F0B66} = {B74BED5E-F175-4A6E-B4AC-8625E0E4E287} |
|
93 | 107 |
EndGlobalSection |
94 | 108 |
GlobalSection(ExtensibilityGlobals) = postSolution |
95 | 109 |
SolutionGuid = {849C3668-1CB9-4F98-ADFA-A71F5629384C} |
src/Core/Domain/Leuze.Core.Domain/Domains/Users/DomainUser.cs | ||
---|---|---|
1 |
using System; |
|
1 |
using Leuze.Core.Application.Identity; |
|
2 |
using System; |
|
2 | 3 |
|
3 | 4 |
namespace Leuze.Core.Domain.Domains.Users |
4 | 5 |
{ |
... | ... | |
31 | 32 |
/// The user's identifier from identity provider. |
32 | 33 |
/// </summary> |
33 | 34 |
public Guid UserId { get; private set; } |
35 |
|
|
36 |
/// <summary> |
|
37 |
/// |
|
38 |
/// </summary> |
|
39 |
public ApplicationUser User { get; private set; } = null!; |
|
34 | 40 |
} |
35 | 41 |
} |
src/Core/Domain/Leuze.Core.Domain/Services/IActiveDirectory.cs | ||
---|---|---|
1 |
namespace Leuze.Core.Domain.Services |
|
2 |
{ |
|
3 |
/// <summary> |
|
4 |
/// |
|
5 |
/// </summary> |
|
6 |
public interface IActiveDirectory |
|
7 |
{ |
|
8 |
} |
|
9 |
} |
src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/DependencyInjection.cs | ||
---|---|---|
1 |
using ExtCore.Infrastructure.Actions; |
|
2 |
using Leuze.Core.Domain.Services; |
|
3 |
using Leuze.Core.Infrastructure.ActiveDirectory.Services; |
|
4 |
using Microsoft.AspNetCore.Builder; |
|
5 |
using Microsoft.Extensions.DependencyInjection; |
|
6 |
using System; |
|
7 |
|
|
8 |
namespace Leuze.Core.Infrastructure.ActiveDirectory |
|
9 |
{ |
|
10 |
/// <summary> |
|
11 |
/// |
|
12 |
/// </summary> |
|
13 |
public class ServicesConfiguration : IConfigureServicesAction |
|
14 |
{ |
|
15 |
/// <summary> |
|
16 |
/// |
|
17 |
/// </summary> |
|
18 |
public int Priority => 1000; |
|
19 |
|
|
20 |
/// <summary> |
|
21 |
/// |
|
22 |
/// </summary> |
|
23 |
/// <param name="services"></param> |
|
24 |
/// <param name="serviceProvider"></param> |
|
25 |
public void Execute(IServiceCollection services, IServiceProvider serviceProvider) |
|
26 |
{ |
|
27 |
services.AddTransient<IActiveDirectory, AdService>(); |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
/// <summary> |
|
32 |
/// |
|
33 |
/// </summary> |
|
34 |
public class ApplicationConfiguration : IConfigureAction |
|
35 |
{ |
|
36 |
/// <summary> |
|
37 |
/// |
|
38 |
/// </summary> |
|
39 |
public int Priority => 11000; |
|
40 |
|
|
41 |
/// <summary> |
|
42 |
/// |
|
43 |
/// </summary> |
|
44 |
/// <param name="applicationBuilder"></param> |
|
45 |
/// <param name="serviceProvider"></param> |
|
46 |
public void Execute(IApplicationBuilder applicationBuilder, IServiceProvider serviceProvider) |
|
47 |
{ |
|
48 |
} |
|
49 |
} |
|
50 |
} |
src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Leuze.Core.Infrastructure.ActiveDirectory.csproj | ||
---|---|---|
1 |
<Project Sdk="Microsoft.NET.Sdk"> |
|
2 |
|
|
3 |
<PropertyGroup> |
|
4 |
<AssemblyName>Leuze.Core.Infrastructure.ActiveDirectory</AssemblyName> |
|
5 |
<RootNamespace>Leuze.Core.Infrastructure.ActiveDirectory</RootNamespace> |
|
6 |
<Product></Product> |
|
7 |
<Description></Description> |
|
8 |
</PropertyGroup> |
|
9 |
|
|
10 |
<PropertyGroup> |
|
11 |
<TargetFramework>net5.0</TargetFramework> |
|
12 |
<Nullable>enable</Nullable> |
|
13 |
<GenerateDocumentationFile>true</GenerateDocumentationFile> |
|
14 |
</PropertyGroup> |
|
15 |
|
|
16 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|
17 |
<OutputPath>..\..\..\Presentation\Leuze.Modules\</OutputPath> |
|
18 |
<DocumentationFile>..\..\..\..\docs\Leuze.Core.Infrastructure.ActiveDirectory.xml</DocumentationFile> |
|
19 |
</PropertyGroup> |
|
20 |
|
|
21 |
<ItemGroup> |
|
22 |
<PackageReference Include="ExtCore.Infrastructure" Version="6.0.0" /> |
|
23 |
</ItemGroup> |
|
24 |
|
|
25 |
<ItemGroup> |
|
26 |
<ProjectReference Include="..\..\Domain\Leuze.Core.Domain\Leuze.Core.Domain.csproj" /> |
|
27 |
</ItemGroup> |
|
28 |
|
|
29 |
</Project> |
src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Services/AdService.cs | ||
---|---|---|
1 |
using Leuze.Core.Domain.Services; |
|
2 |
|
|
3 |
namespace Leuze.Core.Infrastructure.ActiveDirectory.Services |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// |
|
7 |
/// </summary> |
|
8 |
public class AdService : IActiveDirectory |
|
9 |
{ |
|
10 |
} |
|
11 |
} |
src/Core/Infrastructure/Leuze.Core.Infrastructure.Persistence/Registrars/Users/DomainUserRegistrar.cs | ||
---|---|---|
1 |
using ExtCore.Data.EntityFramework; |
|
2 |
using Leuze.Core.Domain.Domains.Users; |
|
3 |
using Microsoft.EntityFrameworkCore; |
|
4 |
|
|
5 |
namespace Leuze.Core.Infrastructure.Persistence.Registrars.Users |
|
6 |
{ |
|
7 |
/// <summary> |
|
8 |
/// |
|
9 |
/// </summary> |
|
10 |
public class DomainUserRegistrar : IEntityRegistrar |
|
11 |
{ |
|
12 |
/// <summary> |
|
13 |
/// |
|
14 |
/// </summary> |
|
15 |
/// <param name="modelbuilder"></param> |
|
16 |
public void RegisterEntities(ModelBuilder modelbuilder) |
|
17 |
{ |
|
18 |
modelbuilder.Entity<DomainUser>(etb => |
|
19 |
{ |
|
20 |
etb.HasKey(e => e.UserId); |
|
21 |
etb.Property(e => e.UserId).ValueGeneratedNever(); |
|
22 |
etb.HasOne(e => e.User).WithOne().HasForeignKey<DomainUser>(e => e.UserId); |
|
23 |
}); |
|
24 |
} |
|
25 |
} |
|
26 |
} |
tests/Core/Leuze.Tests.Core.Infrastructure.ActiveDirectory/Leuze.Tests.Core.Infrastructure.ActiveDirectory.csproj | ||
---|---|---|
1 |
<Project Sdk="Microsoft.NET.Sdk"> |
|
2 |
|
|
3 |
<PropertyGroup> |
|
4 |
<AssemblyName>Leuze.Tests.Core.Infrastructure.ActiveDirectory</AssemblyName> |
|
5 |
<RootNamespace>Leuze.Tests.Core.Infrastructure.ActiveDirectory</RootNamespace> |
|
6 |
<Product></Product> |
|
7 |
<Description></Description> |
|
8 |
</PropertyGroup> |
|
9 |
|
|
10 |
<PropertyGroup> |
|
11 |
<TargetFramework>net5.0</TargetFramework> |
|
12 |
<Nullable>enable</Nullable> |
|
13 |
<IsPackable>false</IsPackable> |
|
14 |
<GenerateDocumentationFile>true</GenerateDocumentationFile> |
|
15 |
</PropertyGroup> |
|
16 |
|
|
17 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|
18 |
<DocumentationFile>..\..\..\docs\Leuze.Tests.Core.Infrastructure.ActiveDirectory.xml</DocumentationFile> |
|
19 |
</PropertyGroup> |
|
20 |
|
|
21 |
<ItemGroup> |
|
22 |
<PackageReference Include="FluentAssertions" Version="5.10.3" /> |
|
23 |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" /> |
|
24 |
<PackageReference Include="xunit" Version="2.4.1" /> |
|
25 |
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> |
|
26 |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|
27 |
<PrivateAssets>all</PrivateAssets> |
|
28 |
</PackageReference> |
|
29 |
<PackageReference Include="coverlet.collector" Version="3.0.3"> |
|
30 |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|
31 |
<PrivateAssets>all</PrivateAssets> |
|
32 |
</PackageReference> |
|
33 |
</ItemGroup> |
|
34 |
|
|
35 |
</Project> |
Také k dispozici: Unified diff
Initialized AD service infrastructure with test project