Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NickStrupat/EntityFramework.Rx
Reactive extension wrappers for *hot* observables of Entity Framework
https://github.com/NickStrupat/EntityFramework.Rx
Last synced: about 2 months ago
JSON representation
Reactive extension wrappers for *hot* observables of Entity Framework
- Host: GitHub
- URL: https://github.com/NickStrupat/EntityFramework.Rx
- Owner: NickStrupat
- License: mit
- Created: 2015-09-11T12:58:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T03:30:03.000Z (almost 5 years ago)
- Last Synced: 2024-07-03T00:37:58.204Z (3 months ago)
- Language: C#
- Size: 83 KB
- Stars: 132
- Watchers: 14
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-core - EntityFramework.Rx - Reactive **hot** observables of your EF operations. (Frameworks, Libraries and Tools / ORM)
- awesome-dotnet-core - EntityFramework.Rx - EF的Reactive 扩展程序。 (框架, 库和工具 / 对象关系映射ORM)
- fucking-awesome-dotnet-core - EntityFramework.Rx - Reactive **hot** observables of your EF operations. (Frameworks, Libraries and Tools / ORM)
- awesome-dotnet-core - EntityFramework.Rx - Reactive **hot** observables of your EF operations. (Frameworks, Libraries and Tools / ORM)
README
# EntityFramework.Rx
Reactive extension wrappers for *hot* observables of Entity Framework entities.
This repo contains the code for both the `EntityFramework` and `EntityFrameworkCore` projects.
## Installation
Simply install the NuGet package for EF6 or EF Core
| EF version | .NET support | NuGet package |
|:-----------|:--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| 6.1.3 | >= 4.6.1 | [![NuGet Status](http://img.shields.io/nuget/v/EntityFramework.Rx.svg?style=flat)](https://www.nuget.org/packages/EntityFramework.Rx/) |
| Core 2.0 | >= 4.6.1 || >= Standard 2.0 | [![NuGet Status](http://img.shields.io/nuget/v/EntityFrameworkCore.Rx.svg?style=flat)](https://www.nuget.org/packages/EntityFrameworkCore.Rx/) |## Usage
`DbObservable` contains methods for each event type supported, which return an IObservable.
- FromInserting
- FromInsertFailed
- FromInserted
- FromUpdating
- FromUpdated
- FromUpdateFailed
- FromDeleting
- FromDeleted
- FromDeleteFailed```csharp
var birthdayMessage = DbObservable.FromInserted()
.Where(x => x.Entity.DateOfBirth.Month == DateTime.Today.Month
&& x.Entity.DateOfBirth.Day == DateTime.Today.Day)
.Subscribe(entry => Console.WriteLine($"Happy birthday to {entry.Entity.Name}!"));
```### Remarks
Specifying a DbContext type with `DbObservable` will contrain events to entities in a DbContext instance of that type.
Events provided by this library and the library which supports it ([EntityFramework.Triggers](https://github.com/NickStrupat/EntityFramework.Triggers)) are co-variant. You can use a base class as `T` in `DbObservable` and the events will be raised as expected.
## Contributing
1. [Create an issue](https://github.com/NickStrupat/EntityFramework.Rx/issues/new)
2. Let's find some point of agreement on your suggestion.
3. Fork it!
4. Create your feature branch: `git checkout -b my-new-feature`
5. Commit your changes: `git commit -am 'Add some feature'`
6. Push to the branch: `git push origin my-new-feature`
7. Submit a pull request :D## History
[Commit history](https://github.com/NickStrupat/EntityFramework.Rx/commits/master)
## License
MIT License