Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor page Partial declarations of 'type' must not specify different base classes [duplicate]

$
0
0

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.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>