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); }
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 }
public IEnumerable <UserAppModel> Get(UserQuery query) { IUserQueriesService userQueriesService = servicesFactory.CreateUserQueriesService(); return(userQueriesService.GetUsers(query)); }
public UserAppModel Get(int id) { IUserQueriesService userQueriesService = servicesFactory.CreateUserQueriesService(); return(userQueriesService.GetUser(id)); }