/// <summary> /// Installs event handlers from the specified assembly. /// </summary> /// <param name="assembly">Assembly with event handlers.</param> /// <param name="mode">In memory or server mode.</param> /// <returns>Event store installer for Castle Windsor.</returns> /// <exception cref="ArgumentNullException"></exception> public static EventStoreInstaller FromAssembly(Assembly assembly, DocumentStoreMode mode) { if (assembly == null) { throw new ArgumentNullException(nameof(assembly)); } return(new EventStoreInstaller(assembly.GetTypes(), mode)); }
private EventStoreInstaller( Tenant[] tenants, IEnumerable <Type> handlerTypes, DocumentStoreMode mode) { this.tenants = tenants; this.handlerTypes = handlerTypes; this.mode = mode; }
public RavenInstaller(Tenant[] tenants) { mode = MvcApplication.Mode switch { ApplicationMode.Debug => DocumentStoreMode.Server, ApplicationMode.Release => DocumentStoreMode.Server, ApplicationMode.Test => DocumentStoreMode.InMemory, _ => throw new ArgumentOutOfRangeException(), }; this.tenants = tenants; }
/// <summary> /// Initializes a new instance of the RavenInstaller class. /// Raven mode is determined depending on debug or release: /// run with server when debugging, and embedded in production. /// </summary> public RavenInstaller() { switch (MvcApplication.Mode) { case ApplicationMode.Debug: mode = DocumentStoreMode.Server; break; case ApplicationMode.Release: mode = DocumentStoreMode.Embeddable; break; case ApplicationMode.Test: mode = DocumentStoreMode.InMemory; break; } }
public RavenInstaller(Tenant[] tenants, DocumentStoreMode mode) { this.tenants = tenants; this.mode = mode; }
private EventStoreInstaller(IEnumerable <Type> handlerTypes, DocumentStoreMode mode) { this.handlerTypes = handlerTypes ?? throw new ArgumentNullException(nameof(handlerTypes)); this.mode = mode; }
/// <summary> /// Initializes a new instance of the RavenInstaller class. /// </summary> /// <param name="mode">Indicates which mode Raven will be run in.</param> public RavenInstaller(DocumentStoreMode mode) { this.mode = mode; }
public static EventStoreInstaller FromAssembly(Tenant[] tenants, Assembly assembly, DocumentStoreMode mode) { return(assembly == null ? throw new ArgumentNullException(nameof(assembly)) : new EventStoreInstaller(tenants, assembly.GetTypes(), mode)); }