public async Task <Result> EditPublisher(EditPublisherRequest editValues) { if (!editValues.SomethingChanged()) { return(Result.Failure("You need to specify something to change.")); } if (editValues.Budget.HasValue && editValues.Budget.Value > 100) { return(Result.Failure("Budget cannot be set to over $100.")); } if (editValues.Budget.HasValue && editValues.Budget.Value < 0) { return(Result.Failure("Budget cannot be set to under $0.")); } if (editValues.WillReleaseGamesDropped.HasValue && editValues.WillReleaseGamesDropped.Value > editValues.Publisher.LeagueYear.Options.WillReleaseDroppableGames) { return(Result.Failure("Will release games dropped cannot be set to more than is allowed in the league.")); } if (editValues.WillNotReleaseGamesDropped.HasValue && editValues.WillNotReleaseGamesDropped.Value > editValues.Publisher.LeagueYear.Options.WillNotReleaseDroppableGames) { return(Result.Failure("Will not release games dropped cannot be set to more than is allowed in the league.")); } if (editValues.FreeGamesDropped.HasValue && editValues.FreeGamesDropped.Value > editValues.Publisher.LeagueYear.Options.FreeDroppableGames) { return(Result.Failure("Unrestricted games dropped cannot be set to more than is allowed in the league.")); } LeagueAction leagueAction = new LeagueAction(editValues, _clock.GetCurrentInstant()); await _fantasyCriticRepo.EditPublisher(editValues, leagueAction); return(Result.Success()); }