Alen Alex
CDCloudflare Developers
•Created by Alen Alex on 10/7/2024 in #r2
Hi, hope you all are having good day...
2 replies
CDCloudflare Developers
•Created by Alen Alex on 10/7/2024 in #r2
Hi, hope you all are having good day...
This is my CORS policy configured...
2 replies
What do use in a multi-threaded environment?Dictionary with lock OR ConcurrentDictionary?
My answer would be, its a ready made, time tested solution for accessing dictionary in a concurrent way.
Yes, if you need you can take the approach of manual locking, but for me, why reinventing the wheel, I would already have a lot of other logic to take care of
6 replies
Static property override
as apprendeur said, static lies outside the concept of oops, so you can't achieve dynamic configuration binding like this unless you instantate it as an object...
2 way I can suggest is...
1) Use reflection to get the class name and the classname can be the one that key
2) You can use Attributes and play along a bit with it
26 replies
System.AggregateException: 'Some services are not able to be constructed
If you want to use the configuration which is binded to a class (Options Pattern), you need to wrap the
FlightLegAggregatorSettings
in IOptions<FlightLegAggregatorSettings>
, instead of simply passing the class.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-8.0#the-options-pattern4 replies
Help in need to have an opinion about Scheduler -> Email notification
You could use a scheuling library like Quartz or Hangfire to schedule a Job every 30 mins or 1 hour, and then check from the db and send the email. If you want to go with the cron, the setup something like a console app which will run every 30 min or 1 hour.
Also If there are proper indexes on necessary fields the database operation won't be that expensive
13 replies
set with different values
Yes, I would expect it to compute the value based on the input (value that I set), not based on some random value
a
. If I set Bool2 = true
and the state got changed due to some other random variable seems a bit off for me. I don't think thats an actual behaviour of setter.23 replies