public MatchesController(IMatchesService matchesService) { Guard.WhenArgument(matchesService, nameof(matchesService)).IsNull().Throw(); this.matchesService = matchesService; }
public MatchesController(IMatchesService matchesService, ITeamsService teamsService, IPointsCalculator pointsCalculator) { this.matchesService = matchesService; this.teamsService = teamsService; this.pointsCalculator = pointsCalculator; }
public MatchesController(IMatchesService matchesServices, IPlayersService playersServices) { _matchesServices = matchesServices; _playersServices = playersServices; }
public MatchesController(IMatchesService matchesService, ITeamsService teamsService) { this.matchesService = matchesService; this.teamsService = teamsService; }
public RefereesService(FooteoDbContext dbContext, IMatchesService matchesService, ITeamLeaguesService teamLeaguesService) { this.dbContext = dbContext; this.matchesService = matchesService; this.teamLeaguesService = teamLeaguesService; }
public MatchesController(IMatchesService matchesService) { _matchesService = matchesService; _mapperToMatchModel = new MapperConfiguration(cfg => cfg.CreateMap <Match, MatchViewModel>()).CreateMapper(); _mapperToMatch = new MapperConfiguration(cfg => cfg.CreateMap <MatchViewModel, Match>()).CreateMapper(); }
public HomeController(IMatchesService matchesService) { this.matchesService = matchesService; }
public MatchModule(IBootstrapInjection injection) { JsonSettings.MaxJsonLength = int.MaxValue; _matcheService = injection.Services.Match; _matchRepository = injection.Repositories.Match; Get[EndpointConfigurationEnum.GET_ALL_MATCHES] = p => { var dtos = _matcheService.GetAll() .Select(m => new MatchDTO(m)); return(Response.AsJson(dtos)); }; Get[EndpointConfigurationEnum.GET_ALL_MATCHES] = p => { var dtos = _matcheService.GetAll() .Select(m => new MatchDTO(m)); return(Response.AsJson(dtos)); }; Get[EndpointConfigurationEnum.GET_IMAGE_MATCH] = p => { try { Stream imagem = _matcheService.GetImage(p.id); if (imagem == null) { throw new ArgumentException("Não existe"); } return(Response.FromStream(imagem, "image/jpg")); } catch (ArgumentException) { return(HttpStatusCode.NotFound); } catch (Exception) { return(HttpStatusCode.InternalServerError); } }; Get[EndpointConfigurationEnum.GET_MATCH] = p => { var match = _matcheService.GetMatch(p.id); return(Response.AsJson(new MatchDTO(match))); }; Put[EndpointConfigurationEnum.CHANGE_MATCH] = p => { var matchId = p.id; var userId = p.userId; var match = JsonConvert.DeserializeObject <MatchDTO>(Request.Body.AsString()); _matcheService.UpdateMatch(match.PlayersTeamWinner, match.PlayersTeamLooser, userId, matchId); return(HttpStatusCode.Accepted); }; Post[EndpointConfigurationEnum.UPLOAD_MATCH, true] = async(x, p) => { var bodyStream = GetImageBodyStream(); int type = Convert.ToInt32(x.matchType.Value); await _matcheService.RegisterMatchAsync(bodyStream, (MatchTypeEnum)type); return(HttpStatusCode.OK); }; Post[EndpointConfigurationEnum.UPLOAD_MATCH_DETAILS] = x => { var bodyStream = GetImageBodyStream(); int type = Convert.ToInt32(x.matchType.Value); string dateStr = x.dateTime.ToString(); DateTime date = DateTime.ParseExact(dateStr, "yyyy-MM-dd_HH-mm-ss", CultureInfo.InvariantCulture); var t = _matcheService.RegisterMatchAsync(bodyStream, (MatchTypeEnum)type, date); t.Wait(); return(HttpStatusCode.OK); }; Get["Import"] = p => { var toImport = JsonConvert.DeserializeObject <List <MatchDTO> >( System.IO.File.ReadAllText( @"C:\users\leonardo.kobus\desktop\matches.txt")); toImport.ForEach(m => { try { var file = GetImageFile(m.Date.AddHours(-3)); var result = Domain.Entities.Match.Factory.FromDTO( m.Id, m.Date, m.PlayersTeamWinner, m.PlayersTeamLooser, m.Status, m.Winners, m.Loosers, file, MatchTypeEnum.SOLO ); _matchRepository.Upsert(result.Instance); } catch (Exception ex) { var ops = ""; } }); return("ok"); }; }
public MatchesController(IMatchesService Matches) { _matchesmanager = (MatchesManager)Matches; }
public MatchesController(IMatchesService matchesService, IUserService userService, ILogger <MatchesController> logger) { _matchesService = matchesService; _userService = userService; _logger = logger; }
public LeaguesService(ApplicationDbContext context, IMatchesService matchesService) { _context = context; _matchesService = matchesService; }
public MatchesController(ITeamLeaguesService teamLeaguesService, IFixturesService fixturesService, IFieldsService fieldsService, IPlayersService usersService, IMatchesService matchesService) { this.teamLeaguesService = teamLeaguesService; this.fixturesService = fixturesService; this.fieldsService = fieldsService; this.usersService = usersService; this.matchesService = matchesService; }
public HomeController(IStringLocalizer <HomeController> localizer, ILogger <HomeController> logger, IMatchesService matchesService) { _localizer = localizer; _logger = logger; _matchesService = matchesService; }
public ResultsController(IMatchesService matchesService) { _matchesService = matchesService; }
public MatchesController(IMatchesService matchesService, IUsersService usersService, IPredictionsService predictionsService) { this.matchesService = matchesService; this.usersService = usersService; this.predictionsService = predictionsService; }
public TeamsStatsAggregationService(ITeamsService teamsService, IMatchesService matchesService) { _teamsService = teamsService; _matchesService = matchesService; }
public FixturesController(IFixturesService fixturesService, ILeaguesService leaguesService, IMatchesService matchesService) { this.fixturesService = fixturesService; this.leaguesService = leaguesService; this.matchesService = matchesService; }
public LeagueController(ILeagueService League, ILeagueTeamService leagueTeamService, IMatchesService matchesService) { _Leaguemanager = (LeagueManager)League; _leagueTeamManager = (LeagueTeamManager)leagueTeamService; _matchesManager = (MatchesManager)matchesService; }
public MatchesController(ApplicationDbContext context, ILeaguesService leaguesService, IMatchesService matchesService, ITeamsService teamsService) { _leaguesService = leaguesService; _matchesService = matchesService; _teamsService = teamsService; }
public MatchesController(IMatchesService matchService) { _matchService = matchService; }
public MatchesController(IMatchesService matchesService, IPredictionsService predictionsService) { _matchesService = matchesService; _predictionsService = predictionsService; }
public SeasonAdminControllers(ITeamsService teamsService, IMatchesService matchesService, ILogger <TeamsController> logger) { _teamsService = teamsService; _matchesService = matchesService; _logger = logger; }