Home > database >  Getting this error in dot net :- CS8865 Only records may inherit from records
Getting this error in dot net :- CS8865 Only records may inherit from records

Time:12-06

When I'm using Nop Commerce version 4.50 to create a custom Plugin it is giving me this error. I can't understand why this error is coming i have used the same method as in other Plugin.

With the help of this plugin i should be able to create a custom plugin.I have attached a picture for reference

CodePudding user response:

The base class is apparently declared as

public record BaseNopModel {...}

You are inheriting from this, but a class cannot inherit from a record. Change the definition of your class to.


public record ConfigurationModel : BaseNopModel {...}

and that error will go away.

  • Related