Custom model issues

'page.AppName' threw an exception of type 'System.InvalidOperationException'
   at Squidex.ClientLibrary.Content`1[[Absolved.Models.Pages.HomePageData, Absolved, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetDetails()
   at Squidex.ClientLibrary.Content`1[[Absolved.Models.Pages.HomePageData, Absolved, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].get_AppName()

'page.SchemaName' threw an exception of type 'System.InvalidOperationException'
"   at Squidex.ClientLibrary.Content`1[[Absolved.Models.Pages.HomePageData, 
Absolved, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetDetails()\r\n 

at Squidex.ClientLibrary.Content`1[[Absolved.Models.Pages.HomePageData, 
Absolved, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].get_SchemaName()"

Which Squidex version do you use?

I’m using a cloud version so I’m not sure how to tell. I could do a screen share since it’s a holiday here.

The Content class expect that is used with the REST API and therefore assumes that several other fields are available:

I’m seeing that error in the Locals window

Content has no self link

Maybe my model isn’t built properly?

That’s what the model I’m actually passing to the controller looks like.

using Squidex.ClientLibrary;

namespace Absolved.Models.Pages
{
    public sealed class HomePage : Content<HomePageData>
    {
    }
}

I should mention I’m using GraphQL to get the page data since I have a lot of referenced content.

Yes, I have seen it. Therefore I have said it: It assumes that it is used with REST. You have to create your own class for now.

Any examples I can use for reference?

You can just copy and paste content,. the only problem are the properties that use the links.

Yeah I was going to try that initially but what you just replied was what I was concerned about which is what prompted my question.

@Sebastian
Could you please share the class as I tried to create my own class but issue is being inherited from Contentbase class - public abstract class ContentBase : Entity ?

I am not sure what exactly you mean. This topic is 2 years old so I need a little bit more context.

@Sebastian
There is an issue comes up when I use the Entity object on the Page coming from here. With DataClass it works fine but that is not a project architecture. Entity Object is inherited from Content

if (!Links.TryGetValue(“self”, out var self))
{
throw new InvalidOperationException(“Content has no self link.”);
}

Still don’t get it. What squidex version do you use and what is “from here” and what project architecture?

@Sebastian
I am using version - 7.5.0.0 for the admin. Issues are in the client application which is using Squidex.ClientLibrary version 15.1.0.

I am extending the Squidex Identity project so same architecture is followed.

For the time being, I have initialized Dataclass as passing it instead of Entity class and resolved the issue but another Solved issue came up.

I see a validation error “Not a known field” for all the properties of the Data class while creating a record - [SOLVED] Component - Not a Known Field Validation Error

Please help as struggling with these 2 issues for days now

Can you give a code example?

@Sebastian
I will have to share the complete project for your reference but mainly I am using Squidex.Identity

Could you please let me know when such an error occurs like with what kind of properties/fields?

Sounds like your schema is empty and has no fields or it is a casing issue.

See https://docs.squidex.io/02-documentation/software-development-kits/.net-standard#control-the-casing (I just added that)

Schema has more than 40 fields and also using the [KeepCasing] attribute on the class. I have seen the given link and saw only one change and tried that also by making the properties from Localized to Dictionary<string, string> but same issue.

Any other thoughts?

Enclosing image if you see any thing in the trace and This issue is coming while posting the data on the Button submit.

It could be a data binding issue. Why is it even reading the app property?