dima
Logging for Blazor MAUI Hybrid + Page transitions?
Hey guys, long time no see. I hope someone can help me with two questions I have. I am currently trying out Blazor MAUI Hybrid as a promising solution for future mobile app development that isn't xaml based - I really was not a fan of Xamarin.
1) Does anyone have recommendations on reliable logging/analytics packages? Sentry Blazor is still in backlog, and I didn't see anyone endorse something that captures both .NET and JS issues. Would be nice if anyone has feedback on something they've tested out in production and works well enough.
2) What is the best approach to creating transitions between the screens? The webView in the app feels, well, like a webview, and I want to try to mitigate that in the best possible way to get create a better experience.
1 replies
Generics question
So guys, I am having a little bit of fun with generics. I need some help though.
Lets say I have a class such as this
And I define a Country entity like this
Country.Id now is Guid.
If I were to implement Currency entity that references Country, I would have to define it like this
Yada-yada-yada, some changes occur. I have X entities that reference Guid CountryId.
Now, I decide its better to make Country have an int Id, so I change it to inherit BaseEntity<int>.
I now also have to replicate that change to X other entities that have CountryId as a reference.
The question: Is there a way to reference a type to achieve something along these lines:
This way, when I impact the Country.Id type, it's automatically updated everywhere else 🙂
From what I understand, since all of this is known compile-time, there isn't really a reason why I shouldn't be able to do this, no?
All help appreciated ^_^
13 replies
❔ How to do faster HttpClient requests?
I've done a classic HttpClient initialize once and for-loop it and it takes about 0.7s per request, which is fine-ish but due to the size of my array I would really love to get it faster.
I'm aware that I may be API-limited, but what would be the best way going about proving that?
I've tried having the responses be saved in a concurrent bag, and parallel.foreach-ing my array while creating an httpclient in each iteration.
This was far from the best, and I've understood that. My current implementation has a ConcurrentQueue of HttpClients, with a maximum of 100 parallelisations at once.
Each thread would dequeue an httpClient, do the request and then enqueue it back. But I'm getting worse results like that. It's approximately 50-60 requests in 40s, which is still roughly 0.7-0.8s per requests.
Would this indicate an API limitation, or is my way of optimizing this wrong?
Thanks a ton!
(It's currently being done in a console-app with .NET 6, just to get proof it works)
7 replies