コード例 #1
0
        public static ISessionState ToHandleConnectionState(IConnection aConnection)
        {
            IMCollection <ISessionState> states = new MCollection <ISessionState>
            {
                new SessionStateOpen(),
                new SessionStateClose()
            };

            return(states.Filter(state => state.CanHandle(aConnection)).GetFirst());
        }
コード例 #2
0
        public IPersistenceState ToHandle(IEntity anEntity)
        {
            IMCollection <IPersistenceState> states = new MCollection <IPersistenceState>
            {
                new PersistedState(),
                new NotPersistedState()
            };

            return(states.Filter(state => state.CanHandle(anEntity)).GetFirst());
        }