示例#1
0
 public FamilleTests()
 {
     if (!s_Init)
     {
         Famille.CreerFamille("UnitTest");
         s_Init = true;
     }
 }
        public async Task <Result> HandleAsync(CreerFamilleCommand command, ICommandContext context = null)
        {
            Famille._nomFamilles = (await _familleRepository.GetAllFamillesAsync().ConfigureAwait(false)).Select(f => new NomFamille(f.Nom)).ToList();
            var result = Famille.CreerFamille(command.Nom);

            if (result && result is Result <NomFamille> resultFamille)
            {
                await CoreDispatcher.PublishEventAsync(new FamilleCreee(resultFamille.Value));

                return(Result.Ok());
            }
            return(result);
        }