commit f406279c8130594596de99f12e3d1ee9013acb48
Author: Dominik Chlouba <dchlouba@students.zcu.cz>
Date:   Mon Mar 29 08:52:59 2021 +0200

    Initialized AD service infrastructure with test project

diff --git a/Leuze.sln b/Leuze.sln
index c5d4110..fc944db 100644
--- a/Leuze.sln
+++ b/Leuze.sln
@@ -35,6 +35,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{B74BED5E-F
 EndProject
 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}"
 EndProject
+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}"
+EndProject
+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}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -73,6 +77,14 @@ Global
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1407144F-48F6-404E-A890-961B739D030D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1407144F-48F6-404E-A890-961B739D030D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1407144F-48F6-404E-A890-961B739D030D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1407144F-48F6-404E-A890-961B739D030D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C1813611-5FF2-4E70-B7E5-A4E8553F0B66}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -90,6 +102,8 @@ Global
 		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF} = {C5588326-929D-42B3-912B-9D838373B48E}
 		{B74BED5E-F175-4A6E-B4AC-8625E0E4E287} = {C5588326-929D-42B3-912B-9D838373B48E}
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E} = {B74BED5E-F175-4A6E-B4AC-8625E0E4E287}
+		{1407144F-48F6-404E-A890-961B739D030D} = {6A0F1F61-D0EB-4132-B722-5787D7046CC0}
+		{C1813611-5FF2-4E70-B7E5-A4E8553F0B66} = {B74BED5E-F175-4A6E-B4AC-8625E0E4E287}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {849C3668-1CB9-4F98-ADFA-A71F5629384C}
diff --git a/src/Core/Domain/Leuze.Core.Domain/Domains/Users/DomainUser.cs b/src/Core/Domain/Leuze.Core.Domain/Domains/Users/DomainUser.cs
index 7e1b209..7ecf29e 100644
--- a/src/Core/Domain/Leuze.Core.Domain/Domains/Users/DomainUser.cs
+++ b/src/Core/Domain/Leuze.Core.Domain/Domains/Users/DomainUser.cs
@@ -1,4 +1,5 @@
-﻿using System;
+﻿using Leuze.Core.Application.Identity;
+using System;
 
 namespace Leuze.Core.Domain.Domains.Users
 {
@@ -31,5 +32,10 @@ namespace Leuze.Core.Domain.Domains.Users
         ///     The user's identifier from identity provider.
         /// </summary>
         public Guid UserId { get; private set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public ApplicationUser User { get; private set; } = null!;
     }
 }
diff --git a/src/Core/Domain/Leuze.Core.Domain/Services/IActiveDirectory.cs b/src/Core/Domain/Leuze.Core.Domain/Services/IActiveDirectory.cs
new file mode 100644
index 0000000..1fa4104
--- /dev/null
+++ b/src/Core/Domain/Leuze.Core.Domain/Services/IActiveDirectory.cs
@@ -0,0 +1,9 @@
+﻿namespace Leuze.Core.Domain.Services
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public interface IActiveDirectory
+    {
+    }
+}
diff --git a/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/DependencyInjection.cs b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/DependencyInjection.cs
new file mode 100644
index 0000000..e5a5040
--- /dev/null
+++ b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/DependencyInjection.cs
@@ -0,0 +1,50 @@
+﻿using ExtCore.Infrastructure.Actions;
+using Leuze.Core.Domain.Services;
+using Leuze.Core.Infrastructure.ActiveDirectory.Services;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+using System;
+
+namespace Leuze.Core.Infrastructure.ActiveDirectory
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class ServicesConfiguration : IConfigureServicesAction
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        public int Priority => 1000;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="services"></param>
+        /// <param name="serviceProvider"></param>
+        public void Execute(IServiceCollection services, IServiceProvider serviceProvider)
+        {
+            services.AddTransient<IActiveDirectory, AdService>();
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    public class ApplicationConfiguration : IConfigureAction
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        public int Priority => 11000;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="applicationBuilder"></param>
+        /// <param name="serviceProvider"></param>
+        public void Execute(IApplicationBuilder applicationBuilder, IServiceProvider serviceProvider)
+        {
+        }
+    }
+}
diff --git a/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Leuze.Core.Infrastructure.ActiveDirectory.csproj b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Leuze.Core.Infrastructure.ActiveDirectory.csproj
new file mode 100644
index 0000000..1df276a
--- /dev/null
+++ b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Leuze.Core.Infrastructure.ActiveDirectory.csproj
@@ -0,0 +1,29 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <AssemblyName>Leuze.Core.Infrastructure.ActiveDirectory</AssemblyName>
+    <RootNamespace>Leuze.Core.Infrastructure.ActiveDirectory</RootNamespace>
+    <Product></Product>
+    <Description></Description>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>net5.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <GenerateDocumentationFile>true</GenerateDocumentationFile>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <OutputPath>..\..\..\Presentation\Leuze.Modules\</OutputPath>
+    <DocumentationFile>..\..\..\..\docs\Leuze.Core.Infrastructure.ActiveDirectory.xml</DocumentationFile>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="ExtCore.Infrastructure" Version="6.0.0" />
+  </ItemGroup>
+  
+  <ItemGroup>
+    <ProjectReference Include="..\..\Domain\Leuze.Core.Domain\Leuze.Core.Domain.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Services/AdService.cs b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Services/AdService.cs
new file mode 100644
index 0000000..da687b7
--- /dev/null
+++ b/src/Core/Infrastructure/Leuze.Core.Infrastructure.ActiveDirectory/Services/AdService.cs
@@ -0,0 +1,11 @@
+﻿using Leuze.Core.Domain.Services;
+
+namespace Leuze.Core.Infrastructure.ActiveDirectory.Services
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class AdService : IActiveDirectory
+    {
+    }
+}
diff --git a/src/Core/Infrastructure/Leuze.Core.Infrastructure.Persistence/Registrars/Users/DomainUserRegistrar.cs b/src/Core/Infrastructure/Leuze.Core.Infrastructure.Persistence/Registrars/Users/DomainUserRegistrar.cs
new file mode 100644
index 0000000..6fece90
--- /dev/null
+++ b/src/Core/Infrastructure/Leuze.Core.Infrastructure.Persistence/Registrars/Users/DomainUserRegistrar.cs
@@ -0,0 +1,26 @@
+﻿using ExtCore.Data.EntityFramework;
+using Leuze.Core.Domain.Domains.Users;
+using Microsoft.EntityFrameworkCore;
+
+namespace Leuze.Core.Infrastructure.Persistence.Registrars.Users
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class DomainUserRegistrar : IEntityRegistrar
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="modelbuilder"></param>
+        public void RegisterEntities(ModelBuilder modelbuilder)
+        {
+            modelbuilder.Entity<DomainUser>(etb =>
+            {
+                etb.HasKey(e => e.UserId);
+                etb.Property(e => e.UserId).ValueGeneratedNever();
+                etb.HasOne(e => e.User).WithOne().HasForeignKey<DomainUser>(e => e.UserId);
+            });
+        }
+    }
+}
diff --git a/tests/Core/Leuze.Tests.Core.Infrastructure.ActiveDirectory/Leuze.Tests.Core.Infrastructure.ActiveDirectory.csproj b/tests/Core/Leuze.Tests.Core.Infrastructure.ActiveDirectory/Leuze.Tests.Core.Infrastructure.ActiveDirectory.csproj
new file mode 100644
index 0000000..e66717d
--- /dev/null
+++ b/tests/Core/Leuze.Tests.Core.Infrastructure.ActiveDirectory/Leuze.Tests.Core.Infrastructure.ActiveDirectory.csproj
@@ -0,0 +1,35 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <AssemblyName>Leuze.Tests.Core.Infrastructure.ActiveDirectory</AssemblyName>
+    <RootNamespace>Leuze.Tests.Core.Infrastructure.ActiveDirectory</RootNamespace>
+    <Product></Product>
+    <Description></Description>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <TargetFramework>net5.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <IsPackable>false</IsPackable>
+    <GenerateDocumentationFile>true</GenerateDocumentationFile>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DocumentationFile>..\..\..\docs\Leuze.Tests.Core.Infrastructure.ActiveDirectory.xml</DocumentationFile>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="FluentAssertions" Version="5.10.3" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
+    <PackageReference Include="xunit" Version="2.4.1" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+    <PackageReference Include="coverlet.collector" Version="3.0.3">
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+  </ItemGroup>
+
+</Project>
