Jiry_XD
Explore posts from servers✅ EF Core Junction Tables with seperate columns
In EF Core:
I have entity X which has a list of Item Y
(This will let EF Core make a junction table to represent the many to many relationship)
Now as per my requirements I needed to add a Price to that junction table. So that the price only exists when and if there is a link between X and Y.
So I manually made the junction entity XY and added a single item of X and a single item of Y along with ints for their ID's and I added a decimal price.
Now my question is: Is this the correct way to add columns to Junction tables?
34 replies
✅ Asp .NET Core production settings.json question.
Hi all,
As you know you have an appsettings.json file.
Which contains some general things such as:
We also have a launchsettings.json file
In production when we publish our app, what is the default running environment?
How do I set the ASPNETCORE_ENVIRONMENT to "Production" in production?
How do I set a seperate ConnectionString_SqlServer for production?
Does the published production build have these .json files or do they rely solely on the HOST environment variables?
70 replies
✅ Changing ASPNETCORE_ENVIRONMENT causes broken site.
Hi all,
I am wanting to test our ASP .NET CORE App coupled with Blazor Wasm in production.
So I changed
ASPNETCORE_ENVIRONMENT
to "Production", and altered Program.cs to work with it:
Now I only get a white page and it is showing 3 warnings:
How can I fix this?8 replies
How to prevent nulls using this approach for Object Initializers?
In C# I have this class:
As you can see I have two constructors, when using object initializers I need to use one of them. I like using object initializers using no constructor aka the default constructor but because I added it there is no default so I added it.
But now the problem is that people can call
new EmailAddress()
without passing an email and it can stay null that way?
How can I still be able to have an empty constructor so I can use object initializers without having the risk somoene calls new EmailAdress();
?20 replies
✅ What's new in .NET 8 regarding making a WASM project?
Hello guys,
I am looking into learning Blazor WASM.
I was viewing some tutorials online on how to setup the project but everything seems to have changed since .NET 8.
Normally you could make a Blazor WASM project + ASP .NET Core hosted, now you have to do it manually?
Or is there still an option to do it automatically?
Why did they remove it, is it not the standard anymore? If so what is the new standard?
46 replies