Skip to content

generic table #2604

Answered by ArgoZhang
fastlink30 asked this question in Q&A
Discussion options

You must be logged in to vote

@fastlink30

1 add constrains

public partial class GenericTable<TValue> where TValue : class, new()
{
    [Parameter] public IEnumerable<TValue> data { get; set; }
}

2 declare TValue

<BootstrapBlazorApp.OnlyServer1.Component.GenericTable TValue="GenericClass" data="genericData" />
<BootstrapBlazorApp.OnlyServer1.Component.GenericTable TValue="GenericClass2" data="genericData2" />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ArgoZhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants