public static async Task <TEntity> RecupererParIdAsync <TEntity, TKey>(TKey id) where TEntity : Auditable { using var scope = _scopeFactory.CreateScope(); IUniteDeTravail uniteDeTavail = scope.ServiceProvider.GetService <IUniteDeTravail>(); return(await uniteDeTavail.Repository <TEntity, TKey>().RecupererParIdAsync(id)); }
public GestionnaireCommandeSupprimerEpisode(IUniteDeTravail uniteDeTravail) { _uniteDeTravail = uniteDeTravail; _episodeRepository = _uniteDeTravail.Repository <Episode, int>(); }
private async Task <bool> LibelleDoitEtreUnique(string libelle, CancellationToken cancellationToken) { var episode = await uniteDeTravail.Repository <Episode, int>().RecupererAsync(new SpecificationEpisodeParLibelle(libelle)); return(episode == null); }
public GestionnaireRequeteRecupererToutesEpisodes(IUniteDeTravail uniteDeTravail) { _uniteDeTravail = uniteDeTravail; _episodeRepository = _uniteDeTravail.Repository <Episode, int>(); }
public GestionnaireCommandeModifierEpisode(IUniteDeTravail uniteDeTravail, IMapper mapper) { _mapper = mapper; _uniteDeTravail = uniteDeTravail; _episodeRepository = _uniteDeTravail.Repository <Episode, int>(); }
private async Task <bool> LibelleDoitEtreUnique(CommandeModifierEpisode model, string libelle, CancellationToken cancellationToken) { var episode = await uniteDeTravail.Repository <Episode, int>().RecupererAsync(new SpecificationAutreEpisodeAvecMemeLibelle(libelle)); return(episode == null); }