GithubHelp home page GithubHelp logo

entitystore.net's Introduction

EntityStore.Net

Description

EntityStore.Net is a .NET Utility Class used with an Event Store backend. It is able to store and retrieve entities (C# objects) as well as their associated property changes.

Installation

Package is available through NuGet.

Install-Package EntityStore.Net

Usage

All methods are provided from an EntityStore class. The contructor of this class takes a ConnectionOptions object with the following properties:

public class ConnectionOptions
{
    public string HostAddress { get; set; }
    public int StreamPort { get; set; }
    public int HttpPort { get; set; }
    public UserCredentials UserCredentials { get; set; }
    public ILogger Logger { get; set; }
}

Notes:

  • HostAddress can either be a DNS name or IP Address.
  • StreamPort and HttpPort are defined from the configuration of the instance.
  • The UserCredentials property is a string username/password that has access to the instance.
  • The ILogger type property is actually a requirement of the ProjectionsManager object defined by the main API provided by EventStore. It has the following properties:
public interface ILogger
{
    void Debug(string format, params object[] args);
    void Debug(Exception ex, string format, params object[] args);
    void Error(string format, params object[] args);
    void Error(Exception ex, string format, params object[] args);
    void Info(string format, params object[] args);
    void Info(Exception ex, string format, params object[] args);
}

The EntityStore class is defined with the following methods:

Contructor

public EntityStore(ConnectionOptions connectionOptions) { }

Methods

// Insert a new Entity of type T into the Store. Returns the new stream name of the instered entity.
public string InsertNewEntity<T>(T entity) where T : class { }

// Update an existing Entity of type T in the Store given the stream name provided by the Insert method.
public void UpdateExistingEntity<T>(T entity, string streamName) where T : class { }

// Gets the Entity at the current moment from the given stream name. Will return null if the stream does not exist.
public T GetCurrentEntity<T>(string streamName) where T : class { }

// Gets the Entity at the current moment from the given stream name with History data. Will return null if the stream does not exist.
public EntityWithHistory<T> GetCurrentEntityWithHistory<T>(string streamName) where T : class { }

// Deletes an Entity from the Event Store based on the stream name.
public void DeleteEntityStream(string streamName) { }

// Gets a list of all entities of type T.
public IEnumerable<T> Entities<T>() where T : class { }

entitystore.net's People

Contributors

davisb10 avatar

Watchers

 avatar  avatar

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.