private ICodeSystem QueryCodeSystem(Guid codeSystemGuid)
        {
            var factory = new CodeSystemFactory();
            var dto     = this.sharedContext.CodeSystems.SingleOrDefault(d => d.CodeSystemGUID == codeSystemGuid);

            return(dto != null?factory.Build(dto) : null);
        }
        private IReadOnlyCollection <ICodeSystem> QueryAll(bool includeZeroCountCodeSystems, params Guid[] codeSystemGuids)
        {
            var factory = new CodeSystemFactory();

            var dtos = !includeZeroCountCodeSystems?
                       this.sharedContext.CodeSystems.Where(dto => dto.CodeCountNBR > 0) :
                           this.sharedContext.CodeSystems;

            if (codeSystemGuids.Any())
            {
                dtos = dtos.Where(dto => codeSystemGuids.Contains(dto.CodeSystemGUID));
            }

            dtos = dtos.AsNoTracking();

            return(dtos.OrderBy(dto => dto.CodeSystemNM).Select(factory.Build).ToList());
        }