atakancracker
atakancracker
CC#
Created by salt_pepper1765 on 4/14/2024 in #help
What do use in a multi-threaded environment?Dictionary with lock OR ConcurrentDictionary?
and you might forget to use lock or other developers so its better to make the collection thread safe if its crucial
6 replies
CC#
Created by salt_pepper1765 on 4/14/2024 in #help
What do use in a multi-threaded environment?Dictionary with lock OR ConcurrentDictionary?
ConcurrentDictionary manages thread safety better than just using lock on dictionary operations
6 replies
CC#
Created by Knikedix on 3/12/2024 in #help
multi threaded gate lock OR
what does create a lock with n input values mean ? Iterate over some items and lets say for each 10 items you want to process some action in thread safe way (with use of lock) ?
6 replies
CC#
Created by atakancracker on 3/1/2024 in #help
HttpClientFactory and Keep-Alive
(sorry for duplicate, copied this question from #advanced)
3 replies
CC#
Created by atakancracker on 3/1/2024 in #help
HttpClientFactory and Keep-Alive
ConnectionClose = false and Keep-Alive... and factory doesn't know about it. This looks dangerous
3 replies
CC#
Created by tthomas on 2/18/2024 in #help
.net core web api development in mac OS using VS Code
what do you have in Program.cs and controller attributes ?
13 replies
CC#
Created by tthomas on 2/18/2024 in #help
.net core web api development in mac OS using VS Code
there is no path specified for default route, therefore you get 404
13 replies
CC#
Created by tthomas on 2/18/2024 in #help
.net core web api development in mac OS using VS Code
there is no error actually
13 replies
CC#
Created by John on 2/1/2024 in #help
.NET CORE 6 MVC Threading
if it takes time to upload database then we are lucky, otherwise have to wait form input to complete
22 replies
CC#
Created by John on 2/1/2024 in #help
.NET CORE 6 MVC Threading
if its like a form input then yes but once request reached to controller, other operastions can be done at background and send response immediate
22 replies
CC#
Created by Unmei on 2/1/2024 in #help
How to effectively dispose unmanaged resources?
By doing this controls, also should consider open/close transactions
12 replies
CC#
Created by Unmei on 2/1/2024 in #help
How to effectively dispose unmanaged resources?
In current case, it might be good to check if connection is already closed/disposed, if so dont try to dispose again to prevent exception. And same for querying, if connection is null or closed, create new connection
12 replies
CC#
Created by Unmei on 2/1/2024 in #help
How to effectively dispose unmanaged resources?
its generally good to create and dispose right before and after db queries, less overhead to manage connection/transaction lifetime like this as scoped service
12 replies
CC#
Created by Unmei on 2/1/2024 in #help
How to effectively dispose unmanaged resources?
and beaware when using scoped service in singleton services as it will be constructed once in singleton service
12 replies
CC#
Created by Unmei on 2/1/2024 in #help
How to effectively dispose unmanaged resources?
UserRepository as scoped service, Dispose will be called end of the scope, therefore if UserRepository is injected and used from different services within scope, if its used with using block, second call might have exception because trying to access disposed object
12 replies
CC#
Created by John on 2/1/2024 in #help
.NET CORE 6 MVC Threading
TaskCreationOptions.LongRunning is not recommended if that code block will be triggered too often, cause it might creates new thread for each
22 replies
CC#
Created by John on 2/1/2024 in #help
.NET CORE 6 MVC Threading
if its just milliseconds or seconds then just use like Task.Run without await
22 replies
CC#
Created by John on 2/1/2024 in #help
.NET CORE 6 MVC Threading
for long running tasks see TaskCreationOptions.LongRunning https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md
22 replies
CC#
Created by Turtles on 1/15/2024 in #help
Can't open the properties of my program.
each project has some guid represented inside solution .sln file, probably some mismatch happened, don't know why would it happen but remove and add it back again would fix issue I believe
7 replies
CC#
Created by Turtles on 1/15/2024 in #help
Can't open the properties of my program.
try to remove project from solution and add it back again
7 replies