TJacken
Is having two DbContext on same base antipattern or bad approach?
@jcotton42 thx, didn't know for this feature on ef core. Is there any side effects with using save point? Not sure if db support this, need to check. Do you have idea for any other approach using ef core?
3 replies
Custom HttpMessageHandler to save http request and response in DB
Basically c/p of this:
https://stackoverflow.com/questions/73803758/different-threads-using-same-instance-of-dbcontext-called-from-within-delegatin
42 replies
Seed data from migration
I'm aware of my approach but I don't have much options left. TEST env is protected and I dont have permission to connevt on db and change data. Pipeline will run migration over database and pipeline has permissions to do it over all environments.
13 replies
Azure Open AI preserve history and load instruction files
I will have instructions for ai model in file and will load file, file contains rule what ai should do in general, here I don't need to persist history in file just for duration of conversation.
4 replies
❔ How can I copy a Chart from Excel to Word with OpenXml SDK?
It is impossible, I made to draw excel chart in word but when I change some cell value in excel it doesn't recalculate cell values so when I draw chart in word it draw chart before I updated chart. Only way to success what I want is to reopen excel file in Excel application to force recalculation and save documents. In my case I can't do it because on server I don't have installed Excel application.
8 replies
✅ Mask data when solft delete is applied
Agree with you, I got idea create custom attribute MaskAttribute(string mask = "AnonymousUser") would apply this attribute over properties in User entity class. Override method for delete (custom method) and if soft delete is applied with reflection populate mask on right place and update data in database.
16 replies
❔ Validate list of objects after reading excel file
Could I create PersonValidationService class which will have field private readonly PersonValidator _personValidator, and this person validator will only have those rules:
this service will not have PersonRepository instead I will inject list of emails from database and all emails from excel file (List<string> emailsFromDb, List<string> emailsFromFile).
8 replies
❔ Validate list of objects after reading excel file
Excel file had approximately 100-200 different emails, but this numbers can increase in future.
Would you have some separate service to validate data or?
Why don't you think fluent validation wouldn't be good fit for this scenario?
Why don't you think fluent validation wouldn't be good fit for this scenario?
8 replies