project with MongoDB. All models need to be inherited or valid with respect to some interface. Implemented like this (screen 1), similar is done in IEnumerable + IEnumerable <T>
But then the compiler swears that the property from the non-generalized IBaseModel is not implemented. How can I get out of the situation?
Thx for reply. Unfortunately I can't. The non-generic interface is used in the internal logic. Reason : omit "Id" property type, it's not necessary for MongoDB Driver
can you replace object with string?
Not sure. There can be a case when type of Id property is int or something else
implement the them explicitly something like string IBaseModel.Id => Id; https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/interfaces/explicit-interface-implementation
if you just press ctrl+. with the cursor on the underlined text, it doesn't give you the option?
Обсуждают сегодня