Ejemplo n.º 1
0
 public FriendshipController(AccountEntry accountEntry, AccountProjection accountProjection, ChessgameProjection gameProjection,
                             FriendshipProjection friendshipProjection, RootController rootController)
 {
     AccountEntry         = accountEntry;
     AccountProjection    = accountProjection;
     GameProjection       = gameProjection;
     FriendshipProjection = friendshipProjection;
     RenderCurrentcontent = RenderOverview;
 }
Ejemplo n.º 2
0
        public ChessContext()
        {
            string storePath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "chess.db");

            Type tEvent     = typeof(IEvent);
            Type tTO        = typeof(ITransferObject);
            var  allTypes   = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
            var  knownTypes = allTypes
                              .Where(t => !t.IsAbstract)
                              .Where(t => t.IsClass || t.IsValueType)
                              .Where(t => tEvent.IsAssignableFrom(t) || tTO.IsAssignableFrom(t))
                              .Where(t => t.Namespace.StartsWith($"{nameof(VnodeTest)}.{nameof(BC)}.{nameof(Chess)}")).ToArray();

            JSONFileEventStore store = new JSONFileEventStore(storePath, knownTypes);

            Repository = new Repository(store);
            var bus = MessageBus.Instance;

            ChessProjection = new ChessgameProjection(store, bus);
            ChessProjection.Init();
            ChessHandler = new Chessgame.Handler(Repository, bus);
        }