Пример #1
0
        public ActionResult <FacetDefinition[]> Get(string database)
        {
            ICadmusRepository repository =
                _repositoryProvider.CreateRepository(database);

            return(Ok(repository.GetFacetDefinitions().ToArray()));
        }
Пример #2
0
        public IActionResult GetTextLayerPartTypeId(string database)
        {
            ICadmusRepository repository =
                _repositoryProvider.CreateRepository(database);

            foreach (FacetDefinition facet in repository.GetFacetDefinitions())
            {
                PartDefinition partDef = facet.PartDefinitions
                                         .Find(d => d.RoleId?.StartsWith(
                                                   PartBase.FR_PREFIX, StringComparison.Ordinal) == true);
                if (partDef != null)
                {
                    return(Ok(new { partDef.TypeId }));
                }
            }
            return(Ok(new { TypeId = (string)null }));
        }