Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbonkr/kr.bbon.entityframeworkcore.extensions
EntityFrameworkCore Extensions
https://github.com/bbonkr/kr.bbon.entityframeworkcore.extensions
dotnet dotnet5 dotnet6 dotnet7 ef entity-framework-core hacktoberfest net5 net6 net7 nuget
Last synced: 25 days ago
JSON representation
EntityFrameworkCore Extensions
- Host: GitHub
- URL: https://github.com/bbonkr/kr.bbon.entityframeworkcore.extensions
- Owner: bbonkr
- Created: 2021-01-30T03:10:55.000Z (almost 4 years ago)
- Default Branch: dev
- Last Pushed: 2023-03-20T03:59:42.000Z (over 1 year ago)
- Last Synced: 2024-04-09T21:56:08.207Z (7 months ago)
- Topics: dotnet, dotnet5, dotnet6, dotnet7, ef, entity-framework-core, hacktoberfest, net5, net6, net7, nuget
- Language: C#
- Homepage: https://bbon.kr/kr-bbon-entityframeworkcore-extensions-package/
- Size: 84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
Awesome Lists containing this project
README
# kr.bbon.EntityFrameworkCore.Extensions Package
[![](https://img.shields.io/nuget/v/kr.bbon.EntityFrameworkCore.Extensions)](https://www.nuget.org/packages/kr.bbon.EntityFrameworkCore.Extensions) [![](https://img.shields.io/nuget/dt/kr.bbon.EntityFrameworkCore.Extensions)](https://www.nuget.org/packages/kr.bbon.EntityFrameworkCore.Extensions) ![publish to nuget](https://github.com/bbonkr/kr.bbon.EntityFrameworkCore.Extensions/workflows/publish%20to%20nuget/badge.svg)
## Features
### Sort method
Extends IQueryable interface.
Sort elements with filed name that Use OderBy, OrderByDescending, ThenBy, ThenByDescending methods.
Signature:
`Sort(string fileName, bool isAscending)`
Example code:
See Example project. `example/Example.App`
```csharp
using(var ctx = new ExampleDbContext()){
var result =ctx.Documents.Sort(nameof(Document.Content)).Sort(nameof(Document.Id), false);
}
```### ToPagedModel method
```csharp
public class DocumentModel
{}
public class DocumentPagedModel : PagedModel
{}
//
var page = 1;
var limit = 10;using(var ctx = new ExampleDbContext()){
var result =ctx.Documents
.Select(x => new DocumentModel
{
//
})
.ToPagedModel(page, limit);var items = result.Items; // You got paged items.
}
```## License
Follow the [.net license](https://dotnet.microsoft.com/platform/free) and the [Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore) license.