/// <summary> /// Gets the users. /// </summary> /// <param name="request">The request.</param> /// <returns> /// The users. /// </returns> public IEnumerable <Resource> GetUsers(UsersGetRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } try { var configurationBuilder = this.CreateConfigurationBuilder(); var configReader = ServiceFactory.CreateConfigurationReader(configurationBuilder); var config = configReader.Read(); var service = ServiceFactory.CreateContactService( this.serviceResolver, ConnectionHelper.CreateCosmosUserConnectionInfo(config), ConnectionHelper.CreateCosmosContactConnectionInfo(config), this.logService); var users = service.GetUsers(request); this.logService.LogInformation( "Successfully executed Get at {Timestamp}", DateTime.UtcNow); return(users); } catch (Exception e) { var errorMessage = $"Fatal exception during Get. ErrorMessage message: {e.Message}"; this.logService.LogError(e, errorMessage); throw; } }
public HttpResponseMessage Get([FromUri] UsersGetRequest GetUsers) { List <User> userData = UserProfileServices.Get(GetUsers); ItemsResponse <User> response = new ItemsResponse <User>(); response.Items = userData; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public async Task <IEnumerable <IUserState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IUserState> states = null; var q = new UsersGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = UserProxyUtils.GetOrdersQueryValueString(orders); q.Fields = UserProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = UserProxyUtils.GetFilterQueryValueString(filter); var req = new UsersGetRequest(); req.Query = q; var resp = await _ramlClient.Users.Get(req); UserProxyUtils.ThrowOnHttpResponseError(resp); states = resp.Content; return(states); }
/// <inheritdoc /> public IEnumerable <UserDocument> GetUsers(UsersGetRequest request) { return(this.cosmosRepository.GetAllUsers()); }
public static List <User> Get(UsersGetRequest model) //Gets all users with lat long and search { string UserId = UserService.GetCurrentUserId(); List <User> list = null; UserProfileServices userProfileServices = new UserProfileServices(); List <String> Connection = userProfileServices.GetMyConnections(UserId); DataProvider.ExecuteCmd(GetConnection, "dbo.User_SearchEpic" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@PageSize", model.PageSize); paramCollection.AddWithValue("@PageNumber", model.PageNumber); paramCollection.AddWithValue("@lat", model.Lat); paramCollection.AddWithValue("@lon", model.Lon); paramCollection.AddWithValue("@distance", model.Distance); //paramCollection.AddWithValue("@TagId", model.TagId); taken out, tags decorated later paramCollection.AddWithValue("@SearchString", model.SearchString); }, map : delegate(IDataReader reader, short set) //executes after stored proc { User p = new User(); int startingIndex = 0; //startingOrdinal p.ProfileName = reader.GetSafeString(startingIndex++); p.ProfileEmail = reader.GetSafeString(startingIndex++); p.ProfilePhone = reader.GetSafeString(startingIndex++); p.ProfileMobile = reader.GetSafeString(startingIndex++); p.ProfileWebsite = reader.GetSafeString(startingIndex++); p.ProfileAddress = reader.GetSafeString(startingIndex++); p.ProfileCompany = reader.GetSafeString(startingIndex++); p.UserId = reader.GetSafeString(startingIndex++); p.MediaId = reader.GetSafeInt32(startingIndex++); p.ThemeMediaId = reader.GetSafeInt32(startingIndex++); p.ProfileLastName = reader.GetSafeString(startingIndex++); p.ProfileViewCount = reader.GetSafeInt32(startingIndex++); p.ConnectionsCount = reader.GetSafeInt32(startingIndex++); p.GroupsCount = reader.GetSafeInt32(startingIndex++); p.Tagline = reader.GetSafeString(startingIndex++); p.CardTemplate = reader.GetSafeString(startingIndex++); Medias m = new Medias(); m.MediasTableId = reader.GetSafeInt32(startingIndex++); m.CreatedDate = reader.GetSafeDateTime(startingIndex++); m.ModifiedDate = reader.GetSafeDateTime(startingIndex++); m.MediaType = reader.GetSafeEnum <MediaType>(startingIndex++); m.ContentType = reader.GetSafeString(startingIndex++); m.UserId = reader.GetSafeString(startingIndex++); m.FilePath = reader.GetSafeString(startingIndex++); if (m.MediasTableId > 0) { p.Avatar = m; } p.IsConnected = (Connection != null && Connection.Contains(p.UserId)); Location t = new Location(); t.Id = reader.GetSafeInt32(startingIndex++); t.Latitude = reader.GetSafeDecimal(startingIndex++); t.Longitude = reader.GetSafeDecimal(startingIndex++); t.Address = reader.GetSafeString(startingIndex++); t.City = reader.GetSafeString(startingIndex++); t.State = reader.GetSafeString(startingIndex++); t.ZipCode = reader.GetSafeString(startingIndex++); if (t.Id > 0) { p.Location = t; } if (list == null) { list = new List <User>(); } list.Add(p); } ); return(list); }