I am quite new to Tridion core service so this might be a simple question. I want to get all metadata schemas by passing a publication ID. If some one has ever done this please reply.
Thanks in advance
Okay, here is an example. GetCoreServiceClient returns a SessionAwareCoreServiceClient with Impersonate already called for the correct user.
public static IdentifiableObjectData[] GetMetadataSchemas(string publicationId)
{
using (var client = GetCoreServiceClient())
{
var filter = new RepositoryItemsFilterData
{
SchemaPurposes = new[] { SchemaPurpose.Metadata },
Recursive = true,
ShowNewItems = false,
ItemTypes = new[] { ItemType.Schema }
};
return client.GetList(publicationId, filter);
}
}