WIP: feature/Définition-des-entités-métier-et-interfaces #14
9
Application/Application.csproj
Normal file
9
Application/Application.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
9
Domain/Domain.csproj
Normal file
9
Domain/Domain.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
18
Domain/Entities/Spell.cs
Normal file
18
Domain/Entities/Spell.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Domain.Entities
|
||||
{
|
||||
public class Spell
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
|
||||
public required string Name { get; set; }
|
||||
public required string Type { get; set; }
|
||||
public required string Description { get; set; }
|
||||
public required string Creator { get; set; }
|
||||
public required DateTime CreationDate { get; set; }
|
||||
}
|
||||
}
|
||||
20
Domain/Filters/SpellFilter.cs
Normal file
20
Domain/Filters/SpellFilter.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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; }
|
||||
|
||||
}
|
||||
}
|
||||
20
Domain/Repositories/ISpellRepository.cs
Normal file
20
Domain/Repositories/ISpellRepository.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Domain.Entities;
|
||||
using Domain.Filters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Domain.Repositories
|
||||
{
|
||||
public interface ISpellRepository
|
||||
{
|
||||
Task<ICollection<Spell>> GetAll();
|
||||
Task<Spell> GetSpellById(Guid id);
|
||||
Task<ICollection<Spell>> GetFilteredSpells(SpellFilter spellfilter);
|
||||
Task<Spell> UpdateSpell(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
|
||||
Task<string> DeleteSpell(Spell spell);
|
||||
Task<Spell> CreateSpell(Spell spell);
|
||||
}
|
||||
}
|
||||
9
Infrastructure/Infrastructure.csproj
Normal file
9
Infrastructure/Infrastructure.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@ -7,9 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="DTOs\" />
|
||||
<Folder Include="Interfaces\" />
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -7,11 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Entities\" />
|
||||
<Folder Include="Exceptions\" />
|
||||
<Folder Include="DomainEvents\" />
|
||||
<Folder Include="ValueObjects\" />
|
||||
<Folder Include="Repositories\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Data\" />
|
||||
<Folder Include="Repositories\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="IntegrationTests\" />
|
||||
<Folder Include="UnitTests\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
<Folder Include="Middlewares\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
9
Tests/Tests.csproj
Normal file
9
Tests/Tests.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</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é