[ ] Regression (a behavior that stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ X] Documentation issue or request
[ ] Self hosted with docker
[X ] Self hosted with IIS
[ ] Self hosted with other version
[ ] Cloud version
Version: 3.5
The new multi reference types are great.
However, the document types are not given in the Web API.
How can I find out which ID belongs to which document type?
We use the Squidex.ClientLibrary Nuget.
There is no field yet, but each content has links, which could be used.
"_links": {
"self": {
"href": "/api/content/squidex-website/blog/3e2e99a1-4132-4ef9-857b-473991fe0050",
"method": "GET"
},
And I can also add a field.
Andreas
October 29, 2019, 10:05am
3
ok. aber wie geht das genau?
Ich habe folgende Situation:
Model:
public class PageData
{
public Dictionary<string, string> Title { get; set; }
public Dictionary<string, string> Slug { get; set; }
[JsonConverter(typeof(InvariantConverter))]
public string[] Content { get; set; }
public Dictionary<string, string> MetaKeywords { get; set; }
public Dictionary<string, string> MetaDescription { get; set; }
}
Call:
public async Task<Page> GetAsync(string slug, string lang = "de")
{
var filter = $"data/slug/de eq '{slug}'";
var data = await _clientManager
.GetClient<Page, PageData>("page")
.GetAsync(new ODataQuery { Filter = filter });
return data.Items.FirstOrDefault();
}
The Content field returns all IDs.
Do I have to use OData for linking?
or how can I use the linking?
Sorry, I think I’m standing on the hose.
I have to make a few modifications to the client library. I hope I can do it this evening.
Hi, a new build is on its way which provides the app name and schema name for each content item and also an endpoint to query contents by its ids only:
public ClientQueryTests(ClientQueryFixture fixture)
{
Fixture = fixture;
}
[Fact]
public async Task Should_query_by_ids()
{
var items = await Fixture.Client.GetAsync(new ODataQuery { OrderBy = "data/value/iv asc" });
var itemsById = await Fixture.Client.GetAsync(new HashSet<Guid>(items.Items.Take(3).Select(x => x.EntityId)));
Assert.Equal(3, itemsById.Items.Count);
Assert.Equal(3, itemsById.Total);
foreach (var item in itemsById.Items)
{
Assert.Equal(TestClient.AppName, item.AppName);
Assert.Equal(TestClient.SchemaName, item.SchemaName);
}
}
Have you had a chance to check out the newest version?