Exemple #1
0
        /// <summary>
        /// Get all the unique identifiers of the commands that match the input request settings
        /// </summary>
        private static async Task <IEnumerable <string> > AllLeaguesIdentifierGroupProcess(
            LeaguesIdentifierGroup_Request request,
            ILogger log)
        {
            #region Logging
            if (null != log)
            {
                log.LogInformation($"Creating identifier group processor for leagues");
            }
            #endregion

            #region Input validations
            // If as of date is stupid, clear it
            if (request.AsOfDate.HasValue)
            {
                if (request.AsOfDate.Value.Year < 2000)
                {
                    request.AsOfDate = null;
                }
            }
            #endregion

            IdentifierGroup allLeagues = new IdentifierGroup("Leagues",
                                                             "League",
                                                             "All leagues");

            if (null != allLeagues)
            {
                return(await allLeagues.GetAll(request.AsOfDate));
            }
            else
            {
                return(Enumerable.Empty <string>());
            }
        }
        /// <summary>
        /// Get all the unique identifiers of the commands that match the input request settings
        /// </summary>
        private static async Task <IEnumerable <string> > AllCommandsIdentifierGroupProcess(
            AllCommandsIdentifierGroup_Request request,
            ILogger log)
        {
            #region Logging
            if (null != log)
            {
                log.LogInformation($"Creating identifier group processor for {request.CommandName}");
            }
            #endregion

            #region Input validations
            // If no match status, default to ALL
            if (string.IsNullOrWhiteSpace(request.MatchStatus))
            {
                request.MatchStatus = @"All";
            }
            // If as of date is stupid, clear it
            if (request.AsOfDate.HasValue)
            {
                if (request.AsOfDate.Value.Year < 2000)
                {
                    request.AsOfDate = null;
                }
            }
            #endregion

            IdentifierGroup allCommands = new IdentifierGroup(Constants.Domain_Command,
                                                              request.CommandName,
                                                              request.MatchStatus);

            if (null != allCommands)
            {
                return(await allCommands.GetAll(request.AsOfDate));
            }
            else
            {
                return(Enumerable.Empty <string>());
            }
        }