Ejemplo n.º 1
0
 public MikdaoContextProvider(IEventConfiguration configuration, IMemoizer memoizer, IEventPublisher publisher, IKeyAccessor keyAccessor, IRunRules rulesRunner)
 {
     Configuration = configuration;
     Memoizer      = memoizer;
     Publisher     = publisher;
     KeyAccessor   = keyAccessor;
     _rulesRunner  = rulesRunner;
 }
Ejemplo n.º 2
0
 public SerializationProvider(DocumentContractResolver contractResolver, IKeyAccessor keyAccessor, IProvideDocumentMetadata metadataProvider)
 {
     PocoContractResolver = contractResolver;
     KeyAccessor          = keyAccessor;
     MetadataProvider     = metadataProvider;
     DocumentSerializer   = JsonSerializer.Create(GetDocumentSettings());
     PocoSerializer       = JsonSerializer.Create(GetPocoSettings());
     MetadataSerialzier   = JsonSerializer.Create(GetMetadataSettings());
 }
Ejemplo n.º 3
0
 public DefaultContext(TActor actor, IMemento <TActor> originalState, IKeyAccessor keyAccessor, IEventPublisher eventPublisher)
 {
     Actor         = actor;
     OriginalState = originalState;
     KeyAccessor   = keyAccessor;
     Publisher     = eventPublisher;
     Events        = new List <IEvent>();
     Disposables   = new List <IDisposable>();
 }
Ejemplo n.º 4
0
 public MetadataValueProvider( 
     IKeyAccessor keyAccess, 
     DocumentMetadataProvider metadataProvider, 
     Func<DocumentMetadata, object> getter, 
     Action<DocumentMetadata, object> setter )
 {
     KeyAccess = keyAccess;
     MetadataProvider = metadataProvider;
     Getter = getter;
     Setter = setter;
 }
Ejemplo n.º 5
0
 public MetadataValueProvider(
     IKeyAccessor keyAccess,
     DocumentMetadataProvider metadataProvider,
     Func <DocumentMetadata, object> getter,
     Action <DocumentMetadata, object> setter)
 {
     KeyAccess        = keyAccess;
     MetadataProvider = metadataProvider;
     Getter           = getter;
     Setter           = setter;
 }
Ejemplo n.º 6
0
 public MikadoContext(TActor actor, IMemento <TActor> originalState, IKeyAccessor keyAccessor, IEventPublisher eventPublisher, IRunRules rulesRunner)
 {
     BrokenRules   = new BrokenRulesCollection();
     Events        = new List <IEvent>();
     Disposables   = new List <IDisposable>();
     Actor         = actor;
     OriginalState = originalState;
     KeyAccessor   = keyAccessor;
     Publisher     = eventPublisher;
     _rulesRunner  = rulesRunner;
     _rulesRunner.Subscribe(BrokenRules);
 }
Ejemplo n.º 7
0
        public MetadataValueProviderCache(DocumentMetadataProvider metadataProvider, IKeyAccessor keyAccess)
        {
            MetadataProvider = metadataProvider;
            KeyAccess        = keyAccess;
            ValueProviders   = new ExclusiveConcurrentDictionary <string, MetadataValueProvider>();
            Readers          = new Dictionary <string, Func <DocumentMetadata, object> >()
            {
                { "_id", x => x._id },
                { "_rev", x => x._rev },
                { "_attachments", x => x._attachments },
            };

            Writers = new Dictionary <string, Action <DocumentMetadata, object> >()
            {
                { "_id", (x, v) => x._id = v.ToString() },
                { "_rev", (x, v) => x._rev = v.ToString() },
                { "_attachments", (x, v) => x._attachments = (JObject)v },
            };
        }
Ejemplo n.º 8
0
        public MetadataValueProviderCache( DocumentMetadataProvider metadataProvider, IKeyAccessor keyAccess )
        {
            MetadataProvider = metadataProvider;
            KeyAccess = keyAccess;
            ValueProviders = new ExclusiveConcurrentDictionary<string, MetadataValueProvider>();
            Readers = new Dictionary<string, Func<DocumentMetadata, object>>()
                          {
                              {"_id", x => x._id },
                              {"_rev", x => x._rev },
                              {"_attachments", x => x._attachments },
                          };

            Writers = new Dictionary<string, Action<DocumentMetadata, object>>()
                          {
                              {"_id", ( x, v ) => x._id = v.ToString() },
                              {"_rev", ( x, v ) => x._rev = v.ToString() },
                              {"_attachments", ( x, v ) => x._attachments = (JObject) v },
                          };
        }
Ejemplo n.º 9
0
 public KeyAccessAdapter(IKeyAccessor <T> accessor)
 {
     Accessor = accessor;
 }
Ejemplo n.º 10
0
 public MemoryCache(IKeyAccessor <T> keyAccessor)
 {
     KeyAccessor = keyAccessor;
     store       = new Dictionary <string, IMemento <T> >();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="APIRepository{TRepository, TEntity, TKey}"/> class.
 /// </summary>
 /// <param name="_http">A HttpClient to use to call the WebApi.</param>
 /// <param name="_controllerName">The name of the controller such as "api/Product"</param>
 public APIRepository(HttpClient _http, string _controllerName)
 {
     this._http           = _http;
     this._controllerName = _controllerName;
     _keyAccessor         = KeyAccessorFactory.Create <TEntity, TKey>();
 }
Ejemplo n.º 12
0
 public DocumentUtility(ICouchConfiguration couchConfiguration, IKeyAccessor keyAccessor, IProvideDocumentMetadata metadataProvider)
 {
     configuration    = couchConfiguration;
     KeyAccessor      = keyAccessor;
     MetadataProvider = metadataProvider;
 }
Ejemplo n.º 13
0
 public DocumentUtility( ICouchConfiguration couchConfiguration, IKeyAccessor keyAccessor, IProvideDocumentMetadata metadataProvider )
 {
     configuration = couchConfiguration;
     KeyAccessor = keyAccessor;
     MetadataProvider = metadataProvider;
 }
Ejemplo n.º 14
0
 public OrderStore(CouchProxy couch, IKeyAccessor keyAccessor)
 {
     Couch       = couch;
     KeyAccessor = keyAccessor;
 }
Ejemplo n.º 15
0
 public RedisProxy(IKeyAccessor keyAccessor, IRedisClient client)
 {
     KeyAccessor = keyAccessor;
     Client      = client;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MemoryRepository{TRepository, TEntity, TKey}"/> class.
 /// </summary>
 public MemoryRepository()
 {
     data         = new Dictionary <TKey, TEntity>();
     _keyAccessor = KeyAccessorFactory.Create <TEntity, TKey>();
 }
Ejemplo n.º 17
0
 public DefaultActorFactory(IKeyAccessor keyAccessor)
 {
     KeyAccessor = keyAccessor;
 }
Ejemplo n.º 18
0
 public CouchProxy(IKeyAccessor keyAccessor, IDocumentRepository repository)
 {
     KeyAccessor = keyAccessor;
     Repository  = repository;
 }