public virtual IActionResult GetCFDocument([FromRoute] string sourcedId)
        {
            CompetencyContextData data = new CompetencyContextData(_connectionString);

            if (!sourcedId.Contains("."))
            {
                return(new BadRequestResult());
            }

            string[]     sourceValues = sourcedId.Split('.');
            ObjectResult result       = null;

            switch (sourceValues[0])
            {
            case "COURSE":
                Course course = data.GetCourse(sourceValues[1]);

                if (course != null)
                {
                    var example = CFDocumentSetMapper.Map(course).ToJson();
                    result = new ObjectResult(example);
                }
                break;

            case "CREDENTIAL":
                Credential cred = data.GetCredential(sourceValues[1]);

                if (cred != null)
                {
                    var example = CFDocumentSetMapper.Map(cred).ToJson();
                    result = new ObjectResult(example);
                }
                break;

            case "ORGANIZATION":
                Organization org = data.GetOrganization(sourceValues[2]);

                if (org != null)
                {
                    var example = CFDocumentSetMapper.Map(org).ToJson();
                    result = new ObjectResult(example);
                }
                break;
            }

            if (result == null)
            {
                return(new NotFoundObjectResult(sourcedId));
            }

            return(result);
        }
        public virtual IActionResult GetAllCFDocuments()
        {
            int?   limit  = 100;
            int?   offset = 0;
            string filter = string.Empty;
            CompetencyContextData data    = new CompetencyContextData(_connectionString);
            CFDocumentSetType     example = null;

            if (!string.IsNullOrEmpty(filter))
            {
                string[] filters = filter.Split('=');

                if (filters.Length == 2)
                {
                    switch (filters[1])
                    {
                    case "COURSE":
                        List <Course> courses = data.GetCourses(limit ?? 100, offset ?? 0);
                        example = CFDocumentSetMapper.Map(courses);
                        break;

                    case "ORGANIZATION":
                        List <Organization> orgs = data.GetOrganizations(limit ?? 100, offset ?? 0);
                        example = CFDocumentSetMapper.Map(orgs);
                        break;

                    case "CREDENTIAL":
                        List <Credential> creds = data.GetCredentials(limit ?? 100, offset ?? 0);
                        example = CFDocumentSetMapper.Map(creds);
                        break;
                    }
                }
            }

            if (example == null)
            {
                List <Course> courses = data.GetCourses(limit ?? 100, offset ?? 0);
                example = CFDocumentSetMapper.Map(courses);
            }
            return(new ObjectResult(example));
        }