예제 #1
0
        /// <summary>
        /// Creates a SeasonResult object.
        /// </summary>
        /// <returns>True if object successfully created with input params. False if not and out param is set to empty object.</returns>
        public bool TryCreate(string team, int goalsFor, int goalsAgainst, out ISeasonResult seasonResult)
        {
            try
            {
                seasonResult = new SeasonResult(team, goalsFor, goalsAgainst);
            }
            catch (Exception ex)
            {
                _loggingService.Log("Unable to create SeasonResult object from numeric values.", ex);
                seasonResult = SeasonResult.EmptySeasonResult;
            }

            return((SeasonResult)seasonResult != SeasonResult.EmptySeasonResult);
        }