TJacken
TJacken
CC#
Created by TJacken on 10/25/2024 in #help
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
CC#
Created by TJacken on 7/20/2024 in #help
Custom HttpMessageHandler to save http request and response in DB
You are right, so your advice would be to use asp.net core middleware UseHttpLogging()?
42 replies
CC#
Created by TJacken on 7/20/2024 in #help
Custom HttpMessageHandler to save http request and response in DB
Why so angry 🤣
42 replies
CC#
Created by TJacken on 7/20/2024 in #help
Custom HttpMessageHandler to save http request and response in DB
I'm aware of this but this is just for testing purpose, will not use on production.
42 replies
CC#
Created by TJacken on 7/20/2024 in #help
Custom HttpMessageHandler to save http request and response in DB
42 replies
CC#
Created by TJacken on 4/24/2024 in #help
Seed data from migration
Okay, but this way of seeding data is not bad option or?
13 replies
CC#
Created by TJacken on 4/24/2024 in #help
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
CC#
Created by TJacken on 3/8/2024 in #help
Template system for chat gpt ASP.NET Core
You are right added template_id in tag accidentally.
11 replies
CC#
Created by TJacken on 3/8/2024 in #help
Template system for chat gpt ASP.NET Core
No description
11 replies
CC#
Created by TJacken on 3/8/2024 in #help
Template system for chat gpt ASP.NET Core
Ah, good to know for next time.
11 replies
CC#
Created by TJacken on 2/8/2024 in #help
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
CC#
Created by Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on 10/27/2023 in #help
❔ how to round numbers like real math
Yeah, you are right, I thought this was his problem.
20 replies
CC#
Created by Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa on 10/27/2023 in #help
❔ how to round numbers like real math
Math.Ceil/Math.Floor
20 replies
CC#
Created by TJacken on 10/10/2023 in #help
❔ 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
CC#
Created by TJacken on 9/8/2023 in #help
✅ 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
CC#
Created by TJacken on 9/8/2023 in #help
✅ Mask data when solft delete is applied
I know for global filter, as @Pobiega said I need some method which would mask data in database from name Lucas it need to rename it to AnonymousUser (for every user who will get IsDeleted flag).
16 replies
CC#
Created by TJacken on 8/14/2023 in #help
❔ 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:
RuleFor(x => x.Email)
.Must(PersonMailDoNotExistInRepository)
.WithMessage("Email already exists in database");

RuleFor(x => x.Email)
.Must(EmailIsNotDuplicateInExcelFile)
.WithMessage("Email is duplicated in excel file");
RuleFor(x => x.Email)
.Must(PersonMailDoNotExistInRepository)
.WithMessage("Email already exists in database");

RuleFor(x => x.Email)
.Must(EmailIsNotDuplicateInExcelFile)
.WithMessage("Email is duplicated in excel file");
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
CC#
Created by TJacken on 8/14/2023 in #help
❔ 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?
8 replies
CC#
Created by TJacken on 8/4/2023 in #help
✅ Blob trigger and save blob information in database
I know :D, but I succeeded in clarifying this flow for myself, so thank you for the advice 🙂
9 replies
CC#
Created by TJacken on 8/4/2023 in #help
✅ Blob trigger and save blob information in database
@.mayormccheese Had same idea, but waited someone to answer, can you tell me what is counter commit to the database?
9 replies