public async Task <ActionResult> UpdateTeam([FromQuery] string name, [FromBody] UpdateLeagueRequest updateLeagueRequest)
        {
            try
            {
                var result = await _leagueService.UpdateAsync((name, updateLeagueRequest));

                return(Ok(result));
            }
            catch (ArgumentException aEx)
            {
                return(BadRequest(aEx.Message));
            }
        }
Beispiel #2
0
        public object Put(UpdateLeagueRequest request)
        {
            var league = Db.SingleById <League>(request.Id);

            league.Throw404NotFoundIfNull("Competition not found");

            league.PopulateWith(request);

            Db.Update(league);

            return(Get(new GetLeagueByIdRequest {
                Id = request.Id
            }));
        }