Click here to Skip to main content
15,567,658 members

Comments by Member 14637786 (Top 11 by date)

Member 14637786 21-Sep-21 8:04am View    
The provided MSDN tells nothing to prove your theory?
When HttpClient instance is created using IHttpClientFactory, Dispose(bool disposing) method has _disposeHandler variable set to false, therefore "using" is redundant code which does nothing even if it calls Dispose method. I am not debating here IF it's worse or the same because I believe it simply doesn't matter but if it makes any profitable difference which I am closer to think it does not. I have found several articles that confirms it so far.
Member 14637786 21-Sep-21 7:40am View    
No, not really, I believe. HttpClientFactory in Core (or 5, whatever we call it) which is used simply as HttpClient injected through DI is managed by DI container which manages lifetimes of services. HttpClient is a bit of an exception since the practice is to keep it alive and shared between threads as long as possible. Using on var response seems like redundant code to me. Let's wait for other opinions.
Member 14637786 8-Sep-21 5:03am View    
Honestly I agree, I am the one who said no to this approach but that's not good enough. I need a decent idea how to make it right. And in my opinion dedicated table per custom type is a better option in terms of clean code, future enhancements and maintenance.
Member 14637786 7-Sep-21 8:02am View    
Does it support filtering over the object Value based on real type? Like CustomProperties.Where( x => (double)x.Value == 20.5)?
Member 14637786 14-Jul-20 13:22pm View    
Post the example of the output you expect. If you want a Dictionary then just deserialize it to it:
var res = JsonConvert.DeserializeObject<list<dictionary<string,object>>>(json);

You do have a dictionary but actually two of them since there are two objects in your collections, you can't just combine them since keys would be duplicated. You need to specify a key like e.g. id and then the value will be e.g an anonymous object with name and type. Depends what you real scenario is.