GithubHelp home page GithubHelp logo

dasiths / neventlite Goto Github PK

View Code? Open in Web Editor NEW
132.0 15.0 19.0 1.34 MB

NEventLite - An extensible lightweight library for .NET that manages the Aggregate lifecycle in an Event Sourced system. Supports Event and Snapshot storage providers like EventStore/Redis or SQL Server. Built with dependency injection in mind and seamlessly integrates with AspNetCore.

License: MIT License

C# 90.14% CSS 0.22% HTML 4.91% JavaScript 4.68% ASP.NET 0.05%
event-sourcing event-store netcore aspnetcore domain-driven-design cqrs-pattern cqrs-es aggregate-root event event-driven

neventlite's People

Contributors

dasiths avatar dependabot[bot] avatar narvalex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neventlite's Issues

Implement new Paging logic using IsEndOfStream for EventstoreEventStorageProvider

Use streamEvents.IsEndOfStream() and streamEvents.NextEventNumber to implement recommended paging method.

var streamEvents = new List<ResolvedEvent>();
StreamEventsSlice currentSlice;
var nextSliceStart = StreamPosition.Start;
do
{
    currentSlice = 
    _eventStoreConnection.ReadStreamEventsForward("myStream", nextSliceStart,
                                                  200, false)
                                                  .Result;

    nextSliceStart = currentSlice.NextEventNumber;

    streamEvents.AddRange(currentSlice.Events);
} while (!currentSlice.IsEndOfStream);

Question about the new() generics constraint on aggregate classes

Hi @dasiths, thank you for your work.

Just a question,
in /src/NEventLite/Repository/Repository.cs (the CreateNewInstance() method), is it necessary to force a public parameter-less constructor to be defined on the aggregate class?
Why not something like this?
return (TAggregate)Activator.CreateInstance(typeof(TAggregate), nonPublic: true);

Thank you in advance. I am new to Github so I am sorry if I am not doing this right.

Add test cases

Add some test cases to aggregate event handling and repository

NEventLite vNext breaking changes

I'm planning to create v2 of NEventLite soon and there will be some breaking changes. It's not formalized yet but I plan to do the following.

  • Move Commands, CommandHandler and ExternalEventHandlers out of the core project as they aren't a critical part of the workflow.
  • Add support for custom Id data type like (Guid, Int or String) for Aggregates and Events.
  • Add support for async (internal) event handlers.

My goal for NEventLite is not to be a full framework that solves every problem but rather solves one particular problem well. It will act as a library that allows you to manage the lifecycle of your aggregates in an event sourced system. You can use the plethora of other (OSS and paid) Command dispatching libraries to create a command pipeline and do the same when you need to dispatch events over the cloud. NEventLite will plugin and work with any of these solutions.

The old version can be found here https://github.com/dasiths/NEventLite_legacy

Intermittent Failure in ReflectionHelper.FindEventHandlerMethodsInAggregate

I have run into an issue where the FindEventHandlerMethodsInAggregate method in ReflectionHelper fails intermittently. I have not been able to chase it down exactly but it seems it could be a threading issue. If I avoid throwing the exception if the dictionary for the Aggregate has already been added (see below), it seems to fix the issue. Thoughts?

if (AggregateEventHandlerCache.TryAdd(aggregateType, eventHandlers) == false 
    && AggregateEventHandlerCache.ContainsKey(aggregateType) == false)
{
    throw new System.Exception($"Error registering methods for handling events in {aggregateType.Name}");
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.