示例#1
0
 public async Task <Ninja> CreateAsync(Ninja ninja)
 {
     if (!await _clanService.IsClanExistsAsync(ninja.Clan.Name))
     {
         throw new ClanNotFoundException(ninja.Clan.Name);
     }
     return(await _ninjaRepository.CreateAsync(ninja));
 }
        public async Task <Ninja> CreateAsync(Ninja ninja)
        {
            await EnforceClanExistenceAsync(ninja.Clan.Name);

            var createdNinja = await _ninjaRepository.CreateAsync(ninja);

            return(createdNinja);
        }