예제 #1
0
        public bool CheckExists(string userName)
        {
            IUserQueriesService  userQueriesService = servicesFactory.CreateUserQueriesService();
            UserQuery            query  = new UserByUsernameQuery(userName);
            IList <UserAppModel> result = userQueriesService.GetUsers(query);

            if (result.Count > 0)
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public UserAppModel Get(string userName)
        {
            IUserQueriesService  userQueriesService = servicesFactory.CreateUserQueriesService();
            UserQuery            query  = new UserByUsernameQuery(userName);
            IList <UserAppModel> result = userQueriesService.GetUsers(query);

            if (result.Count > 0)
            {
                return(result[0]);
            }

            return(null);
        }
        public void CreateUserQueriesService_Test()
        {
            #region === ARRANGE ===

            ApplicationServicesFactory servicesFactory = new ApplicationServicesFactory();

            #endregion

            #region === ACT ===

            IUserQueriesService userQueriesService = servicesFactory.CreateUserQueriesService();

            #endregion

            #region === ASSERT ===

            Assert.IsInstanceOfType(userQueriesService, typeof(IUserQueriesService));

            #endregion
        }
예제 #4
0
        public IEnumerable <UserAppModel> Get(UserQuery query)
        {
            IUserQueriesService userQueriesService = servicesFactory.CreateUserQueriesService();

            return(userQueriesService.GetUsers(query));
        }
예제 #5
0
        public UserAppModel Get(int id)
        {
            IUserQueriesService userQueriesService = servicesFactory.CreateUserQueriesService();

            return(userQueriesService.GetUser(id));
        }