mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
filter props to validate to only those of type Uri
This commit is contained in:
parent
3ddc697ed1
commit
63b33a20ac
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ public async Task<IEnumerable<Uri>> GetAllAsync<TEntityUrls>()
|
|||
var endpoint = BuildEndpoint<TEntityUrls>();
|
||||
var request = new RestRequest(endpoint);
|
||||
var response = await _apiClient.ExecuteAsync<IEnumerable<TEntityUrls>>(request);
|
||||
return response.SelectMany(r => r.GetType().GetProperties().Select(p => (Uri)p.GetValue(r)))
|
||||
return response.SelectMany(r =>
|
||||
r.GetType().GetProperties().Where(p => p.GetType() == typeof(Uri)).Select(p => (Uri)p.GetValue(r)))
|
||||
.Where(u => u != null);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue