First, you need to query the data from your dbContext:
using (var db = new BloggingContext())
{
var blogs = db.Blogs
.Where(b => b.Rating > 3)
.OrderBy(b => b.Url)
.ToList();
}
Then, you need to add the DataGrid control to your XAML page and set the data-binding. I'm not sure what DataGrid control you are using. I suppose you can use the DataGrid from Windows Community Toolkit.
Install this nuget package from the NuGet Package Manger:
Microsoft.Toolkit.UWP.UI.Controls.DataGrid
Add the control and set the data-binding:
<controls:DataGrid x:Name="dataGrid1"
Height="600" Margin="12"
AutoGenerateColumns="True"
ItemsSource="{x:Bind MyViewModel.Customers}" />
This is just code samples from Docs and you need to modify them. FYI:
https://learn.microsoft.com/en-us/ef/core/
https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid_guidance/datagrid_basics