public ActionResult List(string userName) { var profile = new ProfileDecorator(AppContext.DataContext, AppContext.Users[userName].DefaultProfile); var address = profile.Addresses; return(PartialView(address)); }
public SampleApp(IPersistence store, string name, bool useSnapshots, bool quiet, bool fast) { _quiet = quiet; _name = name; _rooms = 32; _storeProfile = new ProfileDecorator(store); _streams = new StreamsFactory(_storeProfile); _aggregateFactory = new DefaultAggregateFactory(); var network = fast ? (INetworkSimulator) new NoNetworkLatencySimulator() : (INetworkSimulator) new ReliableNetworkSimulator(10, 50); _appProjections = new AppProjections(network, quiet); _poller = new PollingClient(_storeProfile, 0, _appProjections, this._loggerFactory); if (useSnapshots) { _cloneProfiler = new TaskProfilingInfo("Cloning state"); var inMemoryPersistence = new InMemoryPersistence(new InMemoryPersistenceOptions { CloneFunc = CloneSnapshot }); _snapshotProfile = new ProfileDecorator(inMemoryPersistence); _snapshots = new DefaultSnapshotStore(_snapshotProfile); } _unboundedOptions = new ExecutionDataflowBlockOptions() { MaxDegreeOfParallelism = DataflowBlockOptions.Unbounded, BoundedCapacity = DataflowBlockOptions.Unbounded, EnsureOrdered = false, MaxMessagesPerTask = DataflowBlockOptions.Unbounded }; _boundedOptions = new ExecutionDataflowBlockOptions() { MaxDegreeOfParallelism = Environment.ProcessorCount * 8, BoundedCapacity = 500, EnsureOrdered = true }; if (store is MongoPersistence) { _unboundedOptions.MaxDegreeOfParallelism = Environment.ProcessorCount * 4; _unboundedOptions.BoundedCapacity = 2000; } }
public StreamTests() { _persistence = new ProfileDecorator(new NullPersistence()); _stream = new Stream("stream", _persistence); }
public ProfileDecoratorTests() { var nullStore = new NullPersistence(); _store = _profile = new ProfileDecorator(nullStore); }
public OptimisticConcurrenctyStreamTests() { _persistence = new ProfileDecorator(new NullPersistence()); _stream = new OptimisticConcurrencyStream("stream", _persistence); }
public DeleteStreamTests() { var persistence = new ProfileDecorator(new InMemoryPersistence()); _stream = new Stream("stream", persistence); }