Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor QuickGrid coverage enhancements #28767

Merged
merged 5 commits into from
Mar 30, 2023
Merged

Blazor QuickGrid coverage enhancements #28767

merged 5 commits into from
Mar 30, 2023

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Mar 24, 2023

Addresses #28001
Addresses #28161

@Nick-Stanton, do you want to take a look at rough 8.0 draft coverage for QuickGrid? The coverage is a WIP 🚧 that I'll be picking back up with late next week, as I'm going to be OOF Monday thru Wednesday. I'll probably merge this now but come back with another PR late next week. If you don't have time to provide feedback now but will have time later, I can ping u on the next PR next week.

Note in passing that we might want to have a more advanced example than this. However, we're linking to the QuickGrid for Blazor app, and that might be all we need to do for an advanced example.

Note also that this whole subject (section) might be better off in a dedicated topic. I'm really feel'in the idea because the Components overview article is already too long. I'm looking for ways to shorten the whole topic generally, and this would stand nicely as its own article in the Components node (folder). Yeah! The more I think about it, the more I LIKE IT! 😆 I'll split it out on the next PR tho, next week.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/components/index.md aspnetcore/blazor/components/index

@Nick-Stanton
Copy link
Member

Nick-Stanton commented Mar 24, 2023

This looks great @guardrex! I would suggest is adding that for people using EF IQueryables, we suggest installing the separate Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter package.

EDIT: Just noticed that the guidance doesn't say that Microsoft.AspNetCore.Components.QuickGrid is a separate package still that should be installed to use.

Blargh, it looks like I didn't write the package description correctly either - https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid

@guardrex
Copy link
Collaborator Author

guardrex commented Mar 25, 2023

Thanks @Nick-Stanton ...

WRT the package, that is versioned here, so that should be ok. I'll look it over one more time tomorrow to confirm. Specifically, I was told that it's going into the framework for .NET 8. In .NET 7, the package has to be added. Let me know if I didn't set that up correctly. Artak prompted me to set that guidance into place for .NET 8 (preview).

.NET 8: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-8.0#quickgrid-component
.NET 7: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-7.0#quickgrid-component

WRT EF IQueryables, yes, I'll work that into the coverage.

@guardrex
Copy link
Collaborator Author

guardrex commented Mar 26, 2023

@Nick-Stanton ... Looking at the Basic Test App, it looks like the Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter package comes in transitively under .NET 8 ...

https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj#L27

... (and it's new for .NET 8) ... so it looks like the guidance won't need to mention adding a pkg ref for it. Let me know if that's incorrect. 👂

I'm going to I cross-link the Basic Test App. I do that in a number of spots around the docs.

https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/testassets/BasicTestApp/QuickGridTest/SampleQuickGridComponent.razor

See if the latest updates do the trick, but look at the PR diff because it took a couple of attempts (commits) for me to the language correct in the right spots.

@Nick-Stanton
Copy link
Member

I'm not sure we have specific tests for the EF IQueryables, which may need to be reevaluated. Here's an example of how it might be consumed from Steve's samples.

https://aspnet.github.io/quickgridsamples/datasources

The project reference looks a little funny here because it's referring to the version in the repo instead of from NuGet.
https://github.com/aspnet/AspLabs/blob/cbca15978abbf6e0eb865d78dd9d8640790fbebf/src/QuickGrid/samples/QuickGridSamples.Server/QuickGridSamples.Server.csproj#L26

https://github.com/aspnet/AspLabs/blob/cbca15978abbf6e0eb865d78dd9d8640790fbebf/src/QuickGrid/samples/QuickGridSamples.Server/Program.cs#L13

FYI, I moved teams and am no longer working on Blazor. I'm happy to answer what I'm able to when I have time, but @SteveSandersonMS has deeper knowledge of how QG works.

@guardrex
Copy link
Collaborator Author

Sorry for the delay to reply, @Nick-Stanton ... I'm OOF for a few days. I'll get back to this later this week when I'm back on my feet. 🤒

@guardrex guardrex self-assigned this Mar 28, 2023
@guardrex
Copy link
Collaborator Author

Here's an example of how it might be consumed from Steve's samples.

I have a feel'in that that's going to be too point-in-time for us to document from. Those types of examples go stale and break. I think we can cross-link to the SampleQuickGridComponent component, as that will be updated over time as they go.

WRT ...

builder.Services.AddQuickGridEntityFrameworkAdapter();

I see. Yes, I'll get that in here.

... and WRT the package reference, I see that I was incorrect about that from the following error language in the ref source (emphasis added) ...

throw new InvalidOperationException($"The supplied {nameof(IQueryable)} is provided by Entity Framework. To query it efficiently, you must reference the package Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter and call AddQuickGridEntityFrameworkAdapter on your service collection.");

@guardrex
Copy link
Collaborator Author

@Nick-Stanton ... Thanks for your help. I made the updates. I'm going to submit another PR to split out this content into a new topic, and I'll ask Steve to review it later, asking him to take a look at all of the coverage and see if I left anything out and/or if he wants to cover anything differently. Thanks again for helping me with the updates.

@guardrex guardrex merged commit 14f3d61 into main Mar 30, 2023
@guardrex guardrex deleted the guardrex-patch-1 branch March 30, 2023 12:10
Donciavas pushed a commit to Donciavas/AspNetCore.Docs that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants