예제 #1
0
        public LoginViewModel(
            ISessionMapper sessionMapper,
            ICreateSessionUseCase createSessionUseCase,
            ISessionLocalDataSource sessionLocalDataSource)
        {
            _createSessionUseCase   = createSessionUseCase;
            _sessionLocalDataSource = sessionLocalDataSource;
            _sessionMapper          = sessionMapper;

            _username = string.Empty;
            _password = string.Empty;

            WhenInitialized
            .SelectMany(_sessionLocalDataSource.ItemsChanged)
            .Select(sessions => sessions.FirstOrDefault())
            .Subscribe(session =>
            {
                if (session == null)
                {
                    return;
                }
                Session = _sessionMapper.ToDomain(session);
            })
            .DisposeWith(Disposables);
        }
 .Select(tuple =>
         _mapper.ToDomain(tuple.validation, tuple.session))
 .SelectMany(entity =>