WIP: feature/Définition-des-entités-métier-et-interfaces #14
@ -10,9 +10,4 @@
|
|||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Controllers\" />
|
|
||||||
<Folder Include="Middlewares\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"applicationUrl": "http://localhost:5225",
|
"applicationUrl": "http://localhost:5044",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
@ -14,7 +14,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"applicationUrl": "https://localhost:7239;http://localhost:5225",
|
"applicationUrl": "https://localhost:7217;http://localhost:5044",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
15
Domain/DTO/UpdateSpell.cs
Normal file
15
Domain/DTO/UpdateSpell.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Domain.Entities;
|
||||||
|
|
||||||
|
namespace Domain.DTO
|
||||||
|
{
|
||||||
|
public class UpdateSpell
|
||||||
|
{
|
||||||
|
public required Guid id { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public string? Type { get; set; }
|
||||||
|
public string? Creator { get; set; }
|
||||||
|
public DateTime? CreationDate { get; set; }
|
||||||
|
public Magician? Magician { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,9 +6,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Data\" />
|
|
||||||
<Folder Include="Repositories\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
10
Domain/Entities/Magician.cs
Normal file
10
Domain/Entities/Magician.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Domain.Entities
|
||||||
|
{
|
||||||
|
public class Magician
|
||||||
|
{
|
||||||
|
public Guid Id { get; private set; }
|
||||||
|
public required string Name { get; set; }
|
||||||
|
public required string Speciality { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Domain/Entities/Spell.cs
Normal file
12
Domain/Entities/Spell.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
namespace Domain.Entities
|
||||||
|
{
|
||||||
|
public class Spell
|
||||||
|
{
|
||||||
|
public Guid Id { get; private set; }
|
||||||
|
public required string Name { get; set; }
|
||||||
|
public required string Type { get; set; }
|
||||||
|
public required string Description { get; set; }
|
||||||
|
public required DateTime CreationDate { get; set; }
|
||||||
|
public required Magician Magician { get; set; }
|
||||||
|
}
|
||||||
|
|
|||||||
|
}
|
||||||
14
Domain/Filters/SpellFilter.cs
Normal file
14
Domain/Filters/SpellFilter.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
namespace Domain.Filters
|
||||||
|
{
|
||||||
|
public class SpellFilter
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Type { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public string? Creator { get; set; }
|
||||||
|
public DateTime? FromDate { get; set; }
|
||||||
|
public DateTime? ToDate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Domain/Repositories/ISpellRepository.cs
Normal file
16
Domain/Repositories/ISpellRepository.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Domain.DTO;
|
||||||
|
using Domain.Entities;
|
||||||
|
using Domain.Filters;
|
||||||
|
|
||||||
|
namespace Domain.Repositories
|
||||||
|
{
|
||||||
|
public interface ISpellRepository
|
||||||
|
{
|
||||||
|
Task<ICollection<Spell>> GetAll();
|
||||||
|
Task<Spell> GetSpellById(Guid id);
|
||||||
|
Task<ICollection<Spell>> GetFilteredSpells(SpellFilter spellfilter);
|
||||||
|
Task<Spell> UpdateSpell(UpdateSpell updateSpellObject);
|
||||||
|
Task<bool> DeleteSpell(Guid id);
|
||||||
|
Task<Spell> CreateSpell(Spell spell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Jonathan
commented
Pourquoi passer un spell entier quand on gagner de la memoire en ne passant que l'id du spell, et des parametres optionnel pour ce qui doit etre modifier? Pourquoi passer un spell entier quand on gagner de la memoire en ne passant que l'id du spell, et des parametres optionnel pour ce qui doit etre modifier?
Blyssco
commented
Afin de fix ceci, je vais créer une classe de style DTO (on peut avoir des dto coté domaine ?) qui elle va gérer les update avec des nullable Afin de fix ceci, je vais créer une classe de style DTO (on peut avoir des dto coté domaine ?) qui elle va gérer les update avec des nullable
|
|||||||
@ -6,9 +6,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="IntegrationTests\" />
|
|
||||||
<Folder Include="UnitTests\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Entities\" />
|
|
||||||
<Folder Include="Exceptions\" />
|
|
||||||
<Folder Include="DomainEvents\" />
|
|
||||||
<Folder Include="ValueObjects\" />
|
|
||||||
<Folder Include="Repositories\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.14.36109.1
|
VisualStudioVersion = 17.14.36109.1
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.API", "Liber_Incantamentum\Liber_Incantamentum.API.csproj", "{BB761821-A9EC-4EBA-83A2-89F32C50041F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Domain\Domain.csproj", "{C045CEDF-9EC0-462F-BA36-B46D80047349}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Domain", "Liber_Incantamentum.Domain\Liber_Incantamentum.Domain.csproj", "{7DF16F8F-C307-455F-8389-5F0B90281347}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{4592C924-1FF7-4819-B918-3EDA45358184}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Application", "Liber_Incantamentum.Application\Liber_Incantamentum.Application.csproj", "{1307DD24-0090-4C5A-B56F-8A815DF46AB9}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{A74B1272-70D9-4745-91E8-76F87872F776}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Infrastructure", "Liber_Incantamentum.Infrastructure\Liber_Incantamentum.Infrastructure.csproj", "{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "Application\Application.csproj", "{D322A7B3-D7B0-4A55-8D9F-C205F6BBD168}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Tests", "Liber_Incantamentum.Tests\Liber_Incantamentum.Tests.csproj", "{4C656BB8-ED7B-422A-A984-75522021B031}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API", "API\API.csproj", "{35729053-7C6D-4D90-80AD-6A0ACF0B9778}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -19,26 +19,26 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{BB761821-A9EC-4EBA-83A2-89F32C50041F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C045CEDF-9EC0-462F-BA36-B46D80047349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{BB761821-A9EC-4EBA-83A2-89F32C50041F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C045CEDF-9EC0-462F-BA36-B46D80047349}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{BB761821-A9EC-4EBA-83A2-89F32C50041F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C045CEDF-9EC0-462F-BA36-B46D80047349}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BB761821-A9EC-4EBA-83A2-89F32C50041F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C045CEDF-9EC0-462F-BA36-B46D80047349}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{7DF16F8F-C307-455F-8389-5F0B90281347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4592C924-1FF7-4819-B918-3EDA45358184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7DF16F8F-C307-455F-8389-5F0B90281347}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4592C924-1FF7-4819-B918-3EDA45358184}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7DF16F8F-C307-455F-8389-5F0B90281347}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4592C924-1FF7-4819-B918-3EDA45358184}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7DF16F8F-C307-455F-8389-5F0B90281347}.Release|Any CPU.Build.0 = Release|Any CPU
|
{4592C924-1FF7-4819-B918-3EDA45358184}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A74B1272-70D9-4745-91E8-76F87872F776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A74B1272-70D9-4745-91E8-76F87872F776}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A74B1272-70D9-4745-91E8-76F87872F776}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A74B1272-70D9-4745-91E8-76F87872F776}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{D322A7B3-D7B0-4A55-8D9F-C205F6BBD168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D322A7B3-D7B0-4A55-8D9F-C205F6BBD168}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D322A7B3-D7B0-4A55-8D9F-C205F6BBD168}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D322A7B3-D7B0-4A55-8D9F-C205F6BBD168}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{4C656BB8-ED7B-422A-A984-75522021B031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{35729053-7C6D-4D90-80AD-6A0ACF0B9778}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4C656BB8-ED7B-422A-A984-75522021B031}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{35729053-7C6D-4D90-80AD-6A0ACF0B9778}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4C656BB8-ED7B-422A-A984-75522021B031}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{35729053-7C6D-4D90-80AD-6A0ACF0B9778}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4C656BB8-ED7B-422A-A984-75522021B031}.Release|Any CPU.Build.0 = Release|Any CPU
|
{35729053-7C6D-4D90-80AD-6A0ACF0B9778}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
@Liber_Incantamentum_HostAddress = http://localhost:5225
|
|
||||||
|
|
||||||
GET {{Liber_Incantamentum_HostAddress}}/weatherforecast/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
@ -6,10 +6,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="DTOs\" />
|
|
||||||
<Folder Include="Interfaces\" />
|
|
||||||
<Folder Include="Services\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
x
Reference in New Issue
Block a user
Penses-tu qu'il soit souhaitable qu'un code externe puisse modifier l'Id d'un Spell après sa création l'entité ne devrais pas etre private?
Ce que je retiens de ce commentaire, faire attention à ce qui doit etre accessible en dehors de la classe ou non, en l'occurence, un id devrait etre accessible uniquement en get étant donné qu'il est unique et propre à l'entité, c'est noté