barcode
❔ Issues with model state validation
Hello, I'm trying to disable model state validation so I can return responses without the standard msdn response
BadRequestException is my exception which is supposed to be caught inside an api filter, this works fine. The main issue is that I can't trigger the invalidmodelstatefactory, If i say suppressModel = false it just doesn't enter the factory and returns 500 internal error frombody is null, and if I say suppressModel = true then I just get the standard msdn response
2 replies
❔ EFCore One-To-One
Hello, I am trying to save working hours as an entry in the database for each business. One approach is to store 14(7 days * 2 from,to) columns, other approach I thought of is to move this to a separate entity WorkingHour which contains from and to and have 7 of them. How would I make the entity convertible to db since it is not normal int, string and it is not a separate entity with a separate table?
7 replies
❔ FluentValidation DTO
Hello, lets say I have a dto like this:
When the user supplies a request, if he doesn't supply center id it will be auto initialized to 0, making it impossible to detect if he even supplied that property
The solution is making the property nullable and checking if .NotNull()
however then IDE cries for nullables so we come to this:
Is this the correct way to setup DTOs?
4 replies
❔ EFCore migrations
Hello, I'm having issues applying configurations with ApplyConfigurationsFromAssembly and have to manually apply configurations
// automatic
//manual
This occurs due to having a CenterCategory many to many table that I handle inside center configuration
3 replies
Static files asp.net
Hello, in my app I have 2 middlewares that are ran before any request but I want to disable them for static files. These middlewares check for a token but i don't want to force the user to be authorized to access some images.
I can't find anything on documentation nor google how to do this. What is the correct way?
2 replies