The first case is simple add the fields in SelectFields method, that is also you mentioned. By the way, if add this params to the FindContentAsync method, it seems have other two implement class don’t have to do this?
The second case is that I mentioned, it has a version param, and query in difference way, like an event message.
The first case is simple add the fields in SelectFields method, that is also you mentioned.
Yes, ideally
By the way, if add this params to the FindContentAsync method, it seems have other two implement class don’t have to do this?
Yes, ideally
The second case is that I mentioned, it has a version param, and query in difference way, like an event message.
Some paths do not need the database, because stuff is already loaded. In this case you also want to make the modifications to the content transformer:
squidex/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs at master · Squidex/squidex · GitHub
It already respects the field names but does not remove them, so you could write a converter which does that.
Because of C#8.0 adding default implementation in interface, my guess is that forgot to implement the ConvertDataAfter method.
If I tried to implement it in this way in AddDefaultValue
, it worked well. I don’t know if the converter is suitable for resolving it; if I add a converter necessary before, maybe we should sort out these converters.
public void ConvertDataAfter(Schema schema, ContentData data)
{
foreach (var field in schema.Fields)
{
if (FieldNames?.Contains(field.Name) == true)
{
continue;
}
data[field.Name] = [];
}
}
Just create a PR and we can discuss it there.