I cannot find why one is accepted as IEnumerable and the other not.
Products is accepted but Recipe gives the error: Error CS0266 :
.... An explicit conversion exists (are you missing a cast?)
But when I change the IENumerable in the OdataEnumerable, the error is gone, but then the DataGrid will not except this as DATA. Also the generic type has to be changed... See below.
@enchev
The problem will not go away,
In de grid.razor.cs the assignment of the field is : protected IEnumerable<Server.Models.PiCon.Recipe> recipes;
the the grid.razor will not accept these and wants an assignment of the field: protected IEnumerable<Recipe> recipes;
but then the grid.razor.cs is complaining..... about the assignment.
both assignments should be correct because the Recipe is in the folder and namespace .Server.Models.PiCon.Recipe
the part in grid.razor.cs:
var resultRecipes = await PiConService.GetRecipes();
recipes = resultRecipes.Value.AsEnumerable();
Yes, the page name is the same, but on other pages it's not a problem.
There is no other Recipe.cs.
Used is
Recipe.cs - Model
Recipe.razor - the Razor design
Recipe.Razor.cs - the code part of the design.
<RadzenPanelMenuItem Text="Recipe" Path="recipe" /> - pagename
This is how C# works - it picks the closest type with the same name in scope. This is why you have to use fully qualified types Server.Models.PiCon.Recipe instead of just Recipe.