Radzen Search screens with self-referencing tables

hi,
i'm experimenting with a radzen screen which has a self referencing table underneath, i.e. a self contained parent / child relationship on the same table,
Create table "Docs"
[Id] [uniqueidentifier] not null,
[childid] uniqueidentifier not null,
[name] nvarchar not null, etc......

there is a FK relationship between Docs.id and Docs.childId which is 1 ID can have many Child Id's

it looks like it's working okay on the add page, however when i navigate to a search page i'm getting a problem with loading the results

the network response i'm getting from the developer window in chrome is;

{"error":{"code":"","message":"The query specified in the URI is not valid. Could not find a property named 'Docs' on type 'TmrGovernance.Models.TmrRadzen.Doc'.","details":[],"innererror":{"message":"Could not find a property named 'Docs' on type 'TmrGovernance.Models.TmrRadzen.Doc'.","type":"Microsoft.OData.ODataException","stacktrace":"   at Microsoft.OData.UriParser.SelectExpandBinder.GenerateExpandItem(ExpandTermToken tokenIn)\r\n   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\r\n   at Microsoft.OData.UriParser.SelectExpandBinder.Bind(ExpandToken expandToken, SelectToken selectToken)\r\n   at Microsoft.OData.UriParser.SelectExpandSemanticBinder.Bind(ODataPathInfo odataPathInfo, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration, BindingState state)\r\n   at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpandImplementation(String select, String expand, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)\r\n   at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpand()\r\n   at Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption.get_SelectExpandClause()\r\n   at Microsoft.AspNetCore.OData.Query.Validator.SelectExpandQueryValidator.Validate(SelectExpandQueryOption selectExpandQueryOption, ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption.Validate(ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.Validator.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.ODataQueryOptions.Validate(ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.EnableQueryAttribute.ValidateQuery(HttpRequest request, ODataQueryOptions queryOptions)\r\n   at Microsoft.AspNetCore.OData.Query.EnableQueryAttribute.OnActionExecuting(ActionExecutingContext actionExecutingContext)"}}}

this seens to be the same on pages where i'm using this database schema, other search pages without this schema approach are working as expected

Further error information

{error: {code: "",…}}
error: {code: "",…}
code: ""
details: []
innererror: {message: "Could not find a property named 'Docs' on type 'TmrGovernance.Models.TmrRadzen.Doc'.",…}
message: "Could not find a property named 'Docs' on type 'TmrGovernance.Models.TmrRadzen.Doc'."
stacktrace: "   at Microsoft.OData.UriParser.SelectExpandBinder.GenerateExpandItem(ExpandTermToken tokenIn)\r\n   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\r\n   at Microsoft.OData.UriParser.SelectExpandBinder.Bind(ExpandToken expandToken, SelectToken selectToken)\r\n   at Microsoft.OData.UriParser.SelectExpandSemanticBinder.Bind(ODataPathInfo odataPathInfo, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration, BindingState state)\r\n   at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpandImplementation(String select, String expand, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)\r\n   at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpand()\r\n   at Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption.get_SelectExpandClause()\r\n   at Microsoft.AspNetCore.OData.Query.Validator.SelectExpandQueryValidator.Validate(SelectExpandQueryOption selectExpandQueryOption, ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption.Validate(ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.Validator.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.ODataQueryOptions.Validate(ODataValidationSettings validationSettings)\r\n   at Microsoft.AspNetCore.OData.Query.EnableQueryAttribute.ValidateQuery(HttpRequest request, ODataQueryOptions queryOptions)\r\n   at Microsoft.AspNetCore.OData.Query.EnableQueryAttribute.OnActionExecuting(ActionExecutingContext actionExecutingContext)"
type: "Microsoft.OData.ODataException"
message: "The query specified in the URI is not valid. Could not find a property named 'Docs' on type 'TmrGovernance.Models.TmrRadzen.Doc'."

The exception says what's the problem. There is no such property defined in $expand parameter.

okay so is this a fault in the generator? this should be a fairly common database schema pattern to work to.

i'm assuming it's a manual fix of sorts?

I'm afraid that I don't understand your scenario. If you are Radzen Professional subscriber please send us your database schema, an example application and detailed instructions how to reproduce the problem at info@radzen.com. We will review your case and we will get back with more info and/or fix if needed.

Hi @enchev ,
im not yet a professional subscriber, planning on that soon providing we can get our ideas built into Radzen. soo far it's looking amazing, cannot tell you how impressed i am with the bulk of this.

anyway, the create table statement is below (simplified) but try to make a CRUD page off this and because (i believe) of the self referencing Foreign Key, i think i'm getting this issue.

CREATE TABLE [dbo].[Docs](
	[Id] [uniqueidentifier] NOT NULL,
	[DisplayId] [nvarchar](50) NOT NULL,
	..REMOVED..
	[ParentId] [uniqueidentifier] NOT NULL,
	..REMOVED..
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_Docs] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[Docs] ADD  CONSTRAINT [DF_Docs_Id]  DEFAULT (newid()) FOR [Id]
GO



ALTER TABLE [dbo].[Docs]  WITH CHECK ADD  CONSTRAINT [FK_Docs_ParentDocs] FOREIGN KEY([ParentId])
REFERENCES [dbo].[Docs] ([Id])
GO

ALTER TABLE [dbo].[Docs] CHECK CONSTRAINT [FK_Docs_ParentDocs]
GO


just for reference, here is another table this is happening on, note the insert event from the Add page works perfectly, i can see the record crated as expected in the underlying DB, however come to the search screen, the page throws an error and no records can be returned

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[RisksStandardsActs](
	[Id] [uniqueidentifier] NOT NULL,
	[DisplayId] [nvarchar](50) NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[Name] [nvarchar](max) NOT NULL,
	[Description] [nvarchar](max) NOT NULL,
	[CreatedById] [nvarchar](450) NOT NULL,
	[CreatedDt] [datetime] NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_RisksStandardsActs] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[RisksStandardsActs] ADD  CONSTRAINT [DF_RisksStandardsActs_Id]  DEFAULT (newid()) FOR [Id]
GO

ALTER TABLE [dbo].[RisksStandardsActs] ADD  CONSTRAINT [DF_RisksStandardsActs_CreatedDt]  DEFAULT (getdate()) FOR [CreatedDt]
GO

ALTER TABLE [dbo].[RisksStandardsActs] ADD  CONSTRAINT [DF_RisksStandardsActs_Status]  DEFAULT ((1)) FOR [Status]
GO

ALTER TABLE [dbo].[RisksStandardsActs]  WITH CHECK ADD  CONSTRAINT [FK_RisksStandardsActs_AspNetUsers] FOREIGN KEY([CreatedById])
REFERENCES [dbo].[AspNetUsers] ([Id])
GO

ALTER TABLE [dbo].[RisksStandardsActs] CHECK CONSTRAINT [FK_RisksStandardsActs_AspNetUsers]
GO

ALTER TABLE [dbo].[RisksStandardsActs]  WITH CHECK ADD  CONSTRAINT [FK_RisksStandardsActs_RisksStandardsActs] FOREIGN KEY([ParentId])
REFERENCES [dbo].[RisksStandardsActs] ([Id])
GO

ALTER TABLE [dbo].[RisksStandardsActs] CHECK CONSTRAINT [FK_RisksStandardsActs_RisksStandardsActs]
GO