https://github.com/brianlparker/blazorwasmodata
https://github.com/brianlparker/blazorwasmodata
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brianlparker/blazorwasmodata
- Owner: BrianLParker
- License: mit
- Created: 2023-01-24T13:33:56.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T13:54:24.000Z (over 3 years ago)
- Last Synced: 2025-01-20T11:46:55.375Z (over 1 year ago)
- Language: C#
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Install Odata on the server:
```
NuGet\Install-Package Microsoft.AspNetCore.OData -Version 8.0.12
```
Install QuickGrid on the Client:
```
NuGet\Install-Package Microsoft.AspNetCore.Components.QuickGrid -Version 0.1.0-alpha.22351.1
```
`Program.cs`
```cs
builder.Services.AddControllers()
.AddOData(options => options.AddRouteComponents(routePrefix: "odata", GetEdmModel())
.Select()
.Filter()
.Expand()
.Count()
.OrderBy()
.SetMaxTop(maxTopValue: 200));
```
```cs
public static IEdmModel GetEdmModel()
{
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet(name: "BlobContainers")
.EntityType.HasKey(blobContainer => blobContainer.ContainerName);
return builder.GetEdmModel();
}
```