I get the syntax-error int the 'Grid1Component.razor' file.The syntax is:The type 'T' in the generic type or method 'IGenericCrudService'. There is no boxing conversion or type parameter conversion from 'T' to 'BaseEntity'.
I'm using .Net9 and Blazor.
My Index.razor file:
@namespace OqtaneLibrary.DefaultGridModule1TEST@inherits ModuleDataBase@inject IGenericCrudService<Activity> _genericCrudServiceGrid1 <Grid1Component T="Activity" _genericCrudServiceGrid1="_genericCrudServiceGrid1" />@code {}And my Grid1Component looks like this:
@namespace OqtaneLibrary.Components@typeparam T @* @typeparam T where T : OqtaneLibrary.Models.BaseEntity // Gives syntax error - Unexpected literals following the typeparam directive. expected 'line-break' *@@code { [Parameter] public IGenericCrudService<T> _genericCrudServiceGrid1 { get; set; } // Syntax error on this stmt.}and the GenericCrusService looks like this:
public interface IGenericCrudService<T> where T : BaseEntity { Task<T> Get(int entityId, int SiteId, int ModuleId, string include = null);...}and the startup has this definition:
services.AddTransient(typeof(IGenericCrudService<>), typeof(GenericCrudService<>)); // Generic serviceAny idea?Thanks.