Skip to content

A .NET Core library designed to make event sourcing simple in small projects

License

Notifications You must be signed in to change notification settings

DSaunders/EasyEvents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyEvents NuGet Version

Making Event Sourcing easy for small applications

  • .NET Core
  • Strongly typed events and handlers
  • Async everywhere
  • Event persistence handled for you. EasyEvents stores events in SqlServer, Postgresql, the file system or in-memory (with more to come)

Raise events, then create handlers that respond to the events and modify application state in memory. When your application re-starts, replay all of the events to restore your in-memory application state with one line of code.

EasyEvents makes is easy to persist events - not state.

PM > Install-Package EasyEvents.Core
public class UserCreated : IEvent
{
    public string Stream => "user-events";
    public string UserName { get; }
    
    public UserCreated(string username) {
        UserName = username;
    }
}
public class UserCreatedHandler : IEventHandler<UserCreated>
{
    public async Task HandleEvent(UserCreated ev)
    {
        Console.WriteLine("Hello, " + ev.UserName);
    }
}
await easyEvents.RaiseEventAsync(new UserCreated("Jane"));

See the Getting Started to find out more about what EasyEvents can do.

About

A .NET Core library designed to make event sourcing simple in small projects

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages