.Net 6.0, EF, Asp.Net Core I'm trying to interrupt my web server's startup if the connection to the db could not be established. I'm thinking that the natural p
My first steps in C# are horrible. Now I'm trying to install Entity Framework. For doing that, I just go to the NuGet package manager, I type "Entity" and try t
i am trying to implement repository pattern in mvc. but I am stuck. I want to return related data. I have two classes , tbl_Account (contains users )and tbl_Cou
I am trying to add a new Template to an existing Client, but when I try to add the Template with an existing ClientID, it instead adds a new Template with a new
var countryCode = new SqlParameter("@countryCode", SqlDbType.VarBinary); var byteArray = Encoding.UTF8.GetBytes(dto.Country); countryCode.Value = byteArray; var
I want to view the edmx diagram like below an example of how it is viewed on windows visual studio I have tried looking at Microsofts documentations regarding
I want to view the edmx diagram like below an example of how it is viewed on windows visual studio I have tried looking at Microsofts documentations regarding
I'm using EF core TPH inheritance to model some data and I'm trying to write a query that will query across different subtypes. My current attempt at writing a
I'm trying to create a many to many relationship in entity Framework Core using Fluent API Here is my first model: MyCalculationSelector.cs public int Sort
In C# My Sql Entity Framework 6 Insert is return exception Cannot add or update a child row: a foreign key constraint fails (portaldb.masterselectionhistory, C
I am using an Enumeration class like this public class SizeUnit : Enumeration { public static SizeUnit Inch = new SizeUnit(1, nameof(Inch)); public static
I had some changes in my ef context and I added new Migraions dotnet ef migrations add changed98112601 then I run the below command dotnet ef database upd
SCENARIO If I split the Entity Framework linq query to evaluate an IQueryable first and after try to include some properties, the value of AccessGroupAccessPoin
I want to pass an additional parameter to the DBContext, like this string myParam="xx"; string con="connenctionstring"; services.AddDbContext<IDbContext, DbC
Can I make the below changes to my databse whilst maintaining the one-to-many relationship? Would my Airport class need to change at all? Existing Flight class:
I have a list of incomplete product models. Everyone is missing an owner and a price. Can these deficiencies be filled with a single query to context? Without t
When running the get method to return a view populated with details, I get the exception saying: System.InvalidCastException: 'Unable to cast object of type 'Sy
I have a database-first .net core 3.1 web application which connects to SQL Server database table with a geography column. The database scaffolding and applicat
I Try To move all my identity Tables to Schema "User" using the following code in my context. it works fine for all except "AspNetUserClaims", "AspNetRoleClaims
I need to intercept the call to the following method of DbProviderServices: DbCommandDefinition CreateDbCommandDefinition(DbProviderManifest providerManifest, D