Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change structure of project #3

Merged
merged 10 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
489 changes: 484 additions & 5 deletions .gitignore

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions MTRPZ4.Service.Tests/MTRPZ4.Service.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion MTRPZ4.Service/MTRPZ4.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.1" />
</ItemGroup>

</Project>
45 changes: 43 additions & 2 deletions MTRPZ4.sln
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.Service", "MTRPZ4.Service\MTRPZ4.Service.csproj", "{04DFAF3A-F16D-4B39-A5F9-F72F2A1AA213}"
# Visual Studio Version 17
VisualStudioVersion = 17.9.34616.47
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTRPZ4.Service", "MTRPZ4.Service\MTRPZ4.Service.csproj", "{04DFAF3A-F16D-4B39-A5F9-F72F2A1AA213}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.Service.Tests", "MTRPZ4.Service.Tests\MTRPZ4.Service.Tests.csproj", "{0F781296-C5DB-4CDD-89B7-08CF27D29547}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTRPZ4.Service.Tests", "MTRPZ4.Service.Tests\MTRPZ4.Service.Tests.csproj", "{0F781296-C5DB-4CDD-89B7-08CF27D29547}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AAD0B957-AC12-456A-9406-92378A35FED7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.Application", "src\MTRPZ4.Application\MTRPZ4.Application.csproj", "{DAE1FE65-53E3-4D97-9A0C-643C522F15C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.Infrastructure", "src\MTRPZ4.Infrastructure\MTRPZ4.Infrastructure.csproj", "{4A3F595C-4763-4A5B-9DEF-47A1D7843C00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.CoreDomain", "src\MTRPZ4.DomainCore\MTRPZ4.CoreDomain.csproj", "{12C6524C-0329-4E67-A675-08C79D4A731F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTRPZ4.UI", "src\MTRPZ4.UI\MTRPZ4.UI.csproj", "{F20DBBB1-BDA7-48AD-8148-7A93724855AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -18,5 +31,33 @@ Global
{0F781296-C5DB-4CDD-89B7-08CF27D29547}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F781296-C5DB-4CDD-89B7-08CF27D29547}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F781296-C5DB-4CDD-89B7-08CF27D29547}.Release|Any CPU.Build.0 = Release|Any CPU
{DAE1FE65-53E3-4D97-9A0C-643C522F15C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DAE1FE65-53E3-4D97-9A0C-643C522F15C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAE1FE65-53E3-4D97-9A0C-643C522F15C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAE1FE65-53E3-4D97-9A0C-643C522F15C1}.Release|Any CPU.Build.0 = Release|Any CPU
{4A3F595C-4763-4A5B-9DEF-47A1D7843C00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A3F595C-4763-4A5B-9DEF-47A1D7843C00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A3F595C-4763-4A5B-9DEF-47A1D7843C00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A3F595C-4763-4A5B-9DEF-47A1D7843C00}.Release|Any CPU.Build.0 = Release|Any CPU
{12C6524C-0329-4E67-A675-08C79D4A731F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12C6524C-0329-4E67-A675-08C79D4A731F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12C6524C-0329-4E67-A675-08C79D4A731F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12C6524C-0329-4E67-A675-08C79D4A731F}.Release|Any CPU.Build.0 = Release|Any CPU
{F20DBBB1-BDA7-48AD-8148-7A93724855AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F20DBBB1-BDA7-48AD-8148-7A93724855AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F20DBBB1-BDA7-48AD-8148-7A93724855AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F20DBBB1-BDA7-48AD-8148-7A93724855AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DAE1FE65-53E3-4D97-9A0C-643C522F15C1} = {AAD0B957-AC12-456A-9406-92378A35FED7}
{4A3F595C-4763-4A5B-9DEF-47A1D7843C00} = {AAD0B957-AC12-456A-9406-92378A35FED7}
{12C6524C-0329-4E67-A675-08C79D4A731F} = {AAD0B957-AC12-456A-9406-92378A35FED7}
{F20DBBB1-BDA7-48AD-8148-7A93724855AA} = {AAD0B957-AC12-456A-9406-92378A35FED7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A10A11A6-B126-4C6D-8D2F-7F7CF18FE829}
EndGlobalSection
EndGlobal
7 changes: 7 additions & 0 deletions src/MTRPZ4.Application/Class1.cs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't use .Application project, than just delete it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace MTRPZ4.Application
{
public class Class1
{

}
}
13 changes: 13 additions & 0 deletions src/MTRPZ4.Application/MTRPZ4.Application.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions src/MTRPZ4.DomainCore/Entities/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTRPZ4.CoreDomain.Entities
{
public class User : IdentityUser
{
public bool IfCompletedTest { get; set; }

}
}
13 changes: 13 additions & 0 deletions src/MTRPZ4.DomainCore/MTRPZ4.CoreDomain.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.5" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions src/MTRPZ4.Infrastructure/ApplicationDBContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using MTRPZ4.CoreDomain.Entities;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTRPZ4.Infrastructure
{
public class ApplicationDBContext : IdentityDbContext<User>
{

public ApplicationDBContext(DbContextOptions<ApplicationDBContext> options) : base(options) { }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDBContext).Assembly);
base.OnModelCreating(modelBuilder);
}

}
}
22 changes: 22 additions & 0 deletions src/MTRPZ4.Infrastructure/ConnectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTRPZ4.Infrastructure
{
public static class ConnectionExtensions
{
public static void AddDBConnection(this IServiceCollection service)
{
IServiceCollection serviceCollection = service.AddDbContext<ApplicationDBContext>(options =>
options.UseInMemoryDatabase("_"));
}
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MTRPZ4.CoreDomain.Entities;

namespace MTRPZ4.Infrastructure.EntityTypeConfiguration
{
internal class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder)
{

builder.Property(u => u.Email)
.IsRequired(true);

builder.Property(u => u.UserName)
.HasMaxLength(30)
.IsRequired(true);

builder.Property(u => u.PasswordHash)
.IsRequired(true);

builder.Property(u => u.IfCompletedTest)
.HasDefaultValue(false);
}
}
}
27 changes: 27 additions & 0 deletions src/MTRPZ4.Infrastructure/IdentityExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using MTRPZ4.CoreDomain.Entities;
using MTRPZ4.Infrastructure;

namespace CoinyProject.Shared.Extensions
{
public static class IdentityExtensions
{
public static void AddIdentityUser(this IServiceCollection service)
{
service.AddDefaultIdentity<User>(options => options.SignIn.RequireConfirmedAccount = false)
.AddEntityFrameworkStores<ApplicationDBContext>()
.AddDefaultTokenProviders();
}

public static void ConfigurateIdentityOptions(this IServiceCollection service)
{
service.Configure<IdentityOptions>(options =>
{
options.Password.RequiredLength = 8;
options.Password.RequireUppercase = false;
});
}
}
}
29 changes: 29 additions & 0 deletions src/MTRPZ4.Infrastructure/MTRPZ4.Infrastructure.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MTRPZ4.DomainCore\MTRPZ4.CoreDomain.csproj" />
</ItemGroup>

</Project>
Loading
Loading