public MatchSummaryAppService(IMapper mapper, ISubscriptionRepository subscriptionRepository, IChampionshipRepository championshipRepository, IGroupChampionshipRepository groupChampionshipRepository) { _championshipRepository = championshipRepository; _subscriptionRepository = subscriptionRepository; _groupChampionshipRepository = groupChampionshipRepository; _mapper = mapper; }
public StandingsAppService(IMatchChampionshipRepository matchChampionshipRepository, ISubscriptionRepository subscriptionRepository, IGroupChampionshipRepository groupChampionshipRepository, IChampionshipRepository championshipRepository) { _matchChampionshipRepository = matchChampionshipRepository; _subscriptionRepository = subscriptionRepository; _groupChampionshipRepository = groupChampionshipRepository; _championshipRepository = championshipRepository; }
public UpdateChampionshipCommandValidator(IChampionshipRepository _championshipRepository, ITeamRepository _teamRepository) { RuleFor(championship => championship.TeamsIds) .NotNull() .Custom((ids, ctx) => { if (ids.Count < 2) { ctx.AddFailure(nameof(Entities.Championship.Teams), "Quantidade de times insuficientes para cadastrar um campeonato!"); } }) .CustomAsync(async(ids, ctx, action) => { var teams = ctx.ParentContext.InstanceToValidate as UpdateChampionshipCommand; teams.SetTeams(await _teamRepository.getTeamsFromIds(ids)); bool valido = (teams.GetTeams().Count == ids.Count); if (!valido) { ctx.AddFailure(nameof(Entities.Championship.Teams), "Ids de times contem registro inválido !"); } }); RuleFor(championship => championship.ChampionshipName) .NotNull() .MaximumLength(200) .CustomAsync(async(teamName, ctx, action) => { var championship = ctx.ParentContext.InstanceToValidate as UpdateChampionshipCommand; bool valido = await _championshipRepository.isUniqueChampionshipName(championship.Id, teamName); if (!valido) { ctx.AddFailure(nameof(Entities.Team.TeamName), "Campeonato informado já cadastrado !"); } }); }
public ValidationResult Validate(IChampionshipRepository championshipRepository, ITeamRepository teamRepository) { ValidationResult validationResult = new UpdateChampionshipCommandValidator(championshipRepository, teamRepository).Validate(this); return validationResult; }
public ChampionshipController(FantacalcioContext context, IChampionshipRepository championshipRepository, ILogger <ChampionshipController> logger) { _context = context; _championshipRepository = championshipRepository; _logger = logger; }
public ChampionshipAppService(IMapper mapper, IChampionshipRepository championshipRepository, IConfiguration configuration) { _championshipRepository = championshipRepository; _mapper = mapper; _configuration = configuration; }
public ChampionshipController(IChampionshipRepository championshipRepository) { _championshipRepository = championshipRepository; }
public ChampionshipHandler(ITeamRepository teamRepository, IChampionshipRepository championshipRepository, ILoggerFactory ILoggerFactory) { _teamRepository = teamRepository; _championshipRepository = championshipRepository; _logger = ILoggerFactory.CreateLogger <TeamHandler>(); }
public SuspendedPlayersAppService(IMatchPlayerChampionshipRepository matchPlayerChampionshipsRepository, IChampionshipRepository championshipRepository) { _matchPlayerChampionshipsRepository = matchPlayerChampionshipsRepository; _championshipRepository = championshipRepository; }