Alen Alex
Alen Alex
CDCloudflare Developers
Created by Alen Alex on 10/7/2024 in #r2
Hi, hope you all are having good day...
No description
2 replies
CDCloudflare Developers
Created by Alen Alex on 10/7/2024 in #r2
Hi, hope you all are having good day...
[
{
"AllowedOrigins": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST"
],
"AllowedHeaders": [
"Content-Type",
"Content-Length"
],
"ExposeHeaders": [
"Access-Control-Allow-Origin"
]
}
]
[
{
"AllowedOrigins": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST"
],
"AllowedHeaders": [
"Content-Type",
"Content-Length"
],
"ExposeHeaders": [
"Access-Control-Allow-Origin"
]
}
]
This is my CORS policy configured...
2 replies
CC#
Created by Darkisad on 4/20/2024 in #help
classification texts with answers
Are you in some chance referring to Text Classification (Machine Learning/AI)?
47 replies
CC#
Created by salty_pepper on 4/14/2024 in #help
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
CC#
Created by WasianLuke on 4/14/2024 in #help
Variable dosent exist.
Please provide the code of what you are trying, what you are trying to explain and what we all grasping would be different, reading what you did will help us understand the context and issue much more faster
9 replies
CC#
Created by Alex on 4/13/2024 in #help
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
CC#
Created by SWEETPONY on 4/10/2024 in #help
System.AggregateException: 'Some services are not able to be constructed
So, instead of what you have replace your current api like this
c#
public FlightLegAggregatorApi(
HttpClientFactory httpClientFactory,
CommonSettings commonSettings,
IOptions<FlightLegAggregatorSettings> flightLegAggregatorOptions //Changing from FlightLegAggregatorSettings to //IOptions<FlightLegAggregatorSettings>
) :
base(httpClientFactory, commonSettings.ContextHeaderName!)
{
this.createFlightLegEndpoint = flightLegAggregatorOptions.FlightLegCreateUri ?? throw new ArgumentNullException(nameof(flightLegAggregatorOptions));
this.updateFlightLegEndpoint = flightLegAggregatorOptions.FlightLegUpdateUri ?? throw new ArgumentNullException(nameof(flightLegAggregatorOptions));
}
c#
public FlightLegAggregatorApi(
HttpClientFactory httpClientFactory,
CommonSettings commonSettings,
IOptions<FlightLegAggregatorSettings> flightLegAggregatorOptions //Changing from FlightLegAggregatorSettings to //IOptions<FlightLegAggregatorSettings>
) :
base(httpClientFactory, commonSettings.ContextHeaderName!)
{
this.createFlightLegEndpoint = flightLegAggregatorOptions.FlightLegCreateUri ?? throw new ArgumentNullException(nameof(flightLegAggregatorOptions));
this.updateFlightLegEndpoint = flightLegAggregatorOptions.FlightLegUpdateUri ?? throw new ArgumentNullException(nameof(flightLegAggregatorOptions));
}
4 replies
CC#
Created by SWEETPONY on 4/10/2024 in #help
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-pattern
4 replies
CC#
Created by thecobylot on 4/10/2024 in #help
Help in need to have an opinion about Scheduler -> Email notification
If properly indexed 😁
13 replies
CC#
Created by thecobylot on 4/10/2024 in #help
Help in need to have an opinion about Scheduler -> Email notification
It would be better if you actually provide code or some more info...
13 replies
CC#
Created by thecobylot on 4/10/2024 in #help
Help in need to have an opinion about Scheduler -> Email notification
Also, honestly whats the issue in calling db?
13 replies
CC#
Created by thecobylot on 4/10/2024 in #help
Help in need to have an opinion about Scheduler -> Email notification
Really depends upon your implementation, You haven't provided how you are doing it...
13 replies
CC#
Created by thecobylot on 4/10/2024 in #help
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
CC#
Created by invalidkit0 on 4/7/2024 in #help
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
CC#
Created by invalidkit0 on 4/7/2024 in #help
set with different values
I too somehow agree with that, silently modifying it internally will be a disaster sometimes
23 replies