1

I have a .NET solution containing a DAL project with the configuration for my entities and a Web API Project containing all my entities which are imported from SQL Server and my controllers are implemented.
When I run the project I have this error (comment is one of the entities which has one-to-many relationship with 2 other entities):

An exception of type 'JsonApiFramework.ServiceModel.ServiceModelException' occurred in JsonApiFramework.Core.dll but was not handled in user code

Additional information: JsonApiFramework.ServiceModel.Internal.ResourceType [clrType=Comment] has missing ResourceIdentityInfo metadata. Ensure metadata is configured correctly for the respective domain/schema.

enter image description here

Camilo Terevinto
  • 26,697
  • 6
  • 67
  • 99

2 Answers2

2

I finally solved the problem. To work efficiently with Json API, the id of every entity should be named simply id. My Entity named Business had an id named idBus. So when I changed the name idBus to id, it all worked.

I hope this can help anybody.

0

You can do the following aswell (if you don't wan't to change your id names):

public class BusinessConfiguration : ResourceTypeBuilder<Business>
{
    public BusinessConfiguration()
    {
        this.ResourceIdentity(x => x.idBus).SetApiType("business");

    }
}
Wouter
  • 1,083
  • 1
  • 11
  • 29