Johannes M
✅ EF Core migrations at design time using Clean Architecture - .NET 7
Was not getting any exception except for the one when trying to create a migration in the terminal.
But for some odd reason when I added the context factory and added the configuration builder in the context I was able to create the migrations and update the database.
34 replies
✅ EF Core migrations at design time using Clean Architecture - .NET 7
I have that statement in my program.cs but when I add a new entity and try creating a migration for it, that's when it fails at times even if I have my web project as the startup project and have the EF Core Tools and EF Core Design packages installed
34 replies
✅ EF Core migrations at design time using Clean Architecture - .NET 7
When I had a look at the microsoft docs it recommended using this particular factory if I wanted to run migrations and when implementing it like it seems to work but I don't trust that this will work well when doing a deployment.
Error: Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time
34 replies
❔ Using HttpContext outside of a controller/request pipeline (.NET 7)
You're right. Unfortunately I do not know of the best way to implement the session state scenario without having to constantly hit the db to populate the session values per request.
because I can do it when a user logs in but when the auth session is still valid it basically hits the home controller and continues to try access the session state values to run other methods
28 replies
❔ Using HttpContext outside of a controller/request pipeline (.NET 7)
The whole menu stuff are part of the layout and change based off of some of the values (it is a multi-tenant system) so certain things like user permissions and actions are based off those values that get stored in session and then the menu will render based on what is set in the session. if you have permissions for a certain path it will show and if not it will not show.
28 replies
❔ Using HttpContext outside of a controller/request pipeline (.NET 7)
What would you say would be the best way of keep track of variables that should stay constant throughout a session's lifetime i.e. I have some helper classes that use the values stored in the session to dynamically create menu items for the sidebar and topbar?
28 replies
❔ Using HttpContext outside of a controller/request pipeline (.NET 7)
Does not need to be static but that was the previous implementation done with framework 4.8, I basically need to bring this up to .NET 7 standards of doing things. A lot of data was stored inside of the session state so that it can be pulled at any point in time using some thing like
So basically instead of constantly reaching out and getting that session state value, you have a class that just does that and you can call the prop.
28 replies