You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First time using this lib, trying to make an FAQPage with multiple questions doesn't really match what the other examples are like.
I could only get it working after a lot of trial and error like this:
var questions = new OneOrMany<IThing>(new List<Question>
{
new Question(){ //question properties },
new Question(){ //question properties }
});
var faqPage = new FAQPage()
{
MainEntity = questions
};
The examples in the test folder use a straight up List<T>, without having to wrap it in a new OneOrMany<IThing>. Adding one question to MainEntity is fine with new Question... straight on the MainEntity prop, which makes it even more counterintuitive imo.
I'm not sure if this expected behaviour, more confusingly it doesn't work with a OneOrMany<Question> either:
Cannot implicitly convert type 'Schema.NET.OneOrMany<Schema.NET.Question>' to Schema.NET.OneOrMany<Schema.NET.IThing>'
If this is expected behaviour, then an example in the Tests folder for an FAQ page would be really helpful.
Steps to reproduce
Try to add a List<Question>of questions to an FAQ MainEntity. It won't allow you to do it.
Expected behaviour
Allow me to add a List without adding a OneOrMany<Question> wrapper.
So the MainEntity property is OneOrMany<IThing> and while we have implicit conversions for OneOrMany etc, if you passed a List<Question>, that can't implicitly convert to a OneOrMany<IThing> but it can to a OneOrMany<Question>.
Now in theory we should be able to make it do it to OneOrMany<IThing> specifically however I also imagine it might get weird for cases like Values<Question, IThing> where it could technically be either one then.
Not sure what a good solution is for this at the moment.
It would be great if an example was added to the folder on how to do this. Regardless I think this ticket should help anyone that searches the project for FAQPage, as there is no documentation at all on it currently.
Describe the bug
First time using this lib, trying to make an FAQPage with multiple questions doesn't really match what the other examples are like.
I could only get it working after a lot of trial and error like this:
The examples in the test folder use a straight up
List<T>
, without having to wrap it in a newOneOrMany<IThing>
. Adding one question to MainEntity is fine with new Question... straight on the MainEntity prop, which makes it even more counterintuitive imo.I'm not sure if this expected behaviour, more confusingly it doesn't work with a
OneOrMany<Question>
either:Cannot implicitly convert type 'Schema.NET.OneOrMany<Schema.NET.Question>' to Schema.NET.OneOrMany<Schema.NET.IThing>'
If this is expected behaviour, then an example in the Tests folder for an FAQ page would be really helpful.
Steps to reproduce
Try to add a
List<Question>
of questions to an FAQ MainEntity. It won't allow you to do it.Expected behaviour
Allow me to add a List without adding a
OneOrMany<Question>
wrapper.Schema objects
The text was updated successfully, but these errors were encountered: