I have razor page with code behind
public partial class MyRazorPage: ComponentBase, IDisposable{ ...}I have several pages that have some common stuff, a lot of common stuff.
I created an abstract class like:
public abstract class MycustomComponentBase<TItem1, TItem2> : ComponentBase where TItem1: class, new() where TItem2: class, new(){ ...}and change razor class page to
public partial class MyRazorPage: MycustomComponentBase<MyClass1, MyClass2>, IDisposable{ ...}won't work because I get:
Error CS0263 Partial declarations of 'MyRazorPage' must not specify different base classes in MyRazorPage.razor.cs
I tried public abstract partial class MycustomComponentBase<TItem1, TItem2> as well but same error.
There's way to do that on partial class? I don't want to use @inherits because authentication and custom routing is working on actual implementation.