I'm trying to migrate an objectcontext/edmx system to dbcontext (EF6) with fluent mapping. I have a few instances like the following. Principal table has a relationship to a dependent table where a non-PK column in the dependent table holds the value of a...
There is more than ...50,000 records... in the table. I am using ...Microsoft SQL Server 2016 (RTM-GDR).......I have used the code to fetch 200 records at a time. The below code seems to work fine till 1000 records but after that it starts taking longer t...
I have a little problem with Entity Framework 6....My application is a WPF C# application, I use SQL SERVER 2012 Express....I try to insert data into my Person table....It was working for a long time. Today I had an error : receiving an invalid column len...
I am new to ASP.NET MVC4 and I have an issue I can't manage to resolve....I have a simple GET endpoint which I want to return all the ...prestations.......When I try to reach this endpoint, I get no response and not even a timeout. My API is working well ...
Will someone please put me out of my misery and let me know what I have/have not done that makes my code fail?...I am using Entity Framework database first. When I query for an entity and request a related entity to be included, I get this error: Invali...
How Entity Framework ...DbContext... works in static method per web request? is there any performance issue? I have 2 classes below . Which one is better to use ? or bad? Do we need get instance all pear request ? is there any issue?...public class MyClas...
I am beginner to Entity Framework. I want to insert employees along with department as foreign key, but I am getting the following error while adding records:...The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_dbo.Employees_dbo.Departm...
I need to define my 3 classes as follows:...public class Table1
{
public Guid Table1CoreId {get;set;}
public string Name {get;set;}
public Table2 Table2 {get;set;}
public Table3 Table3 {get;set;}
}
public class Table2
{
Guid Table1CoreId ...
I want to upload image with some properties value. I can do only upload image
Here is my Image Upload code:... [HttpPost]
[Route("UploadImage")]
public async Task<HttpResponseMessage> ImageUpload()
{
// Check whether the POST operat...
I have a polymorphic collection on one entity type that contains a collection of objects that are the child types of it.
the child types are all stored in different tables in the db. ...I need to map this relationship in the fluent API so I can manage the...
I'm new to asp.net MVC4 and I have an issue with the serialization of an entire Dataset. ...When I return this Dataset, eg. ...db.Prestations.ToList()... and call my endpoint in Postman, the request takes much time and doesn't respond. ...If I put the res...
I'm trying to get a test project running using MySQL and EF6 using Visual Studio 2019 Community Preview for Mac. I am using the ...Web Application (Model-View-Controller)... / ....NET Core -> App... template as a starting point as well as the ...MyWind...
I am a bit baffled as to what I am missing in configurations or whatever that puts this rock in my way....What am I trying to do?... My original testcase was just to grab a collection, .ToList() it and then hand that to the API. Your pretty standard EF qu...
I have my tables as session and semester. For every semester there is always a session which I linked using foreign key, however, my datagrid only displays the integer value of the foreign key, I have tried several answers online to solve this but still n...
I need help here with part of my code so here it is:...I have 6 methods as you can see below that parse incoming data and then returns it as a list, so my issue is to send that list data to my database table SerialNumber, each method of the lists is a sep...
db.DbEnquiryModules... - how to write this query as a lambda expression or linq?...SELECT
tenq.EnquiryID
,tenq.EnquiryNo
,tenq.CompanyID
,tenq.EnquiryDate
,tenq.ClientID
,tenq.Address
,tenq.ContactPerson
,tenq.Email
,...
I was working on a ...Xamarin.Forms... application and using EF 6 targeting ....net standard 2.0.... The application is live on app store with my DBContext class as follows....public class DatabaseContext : DbContext
{
private readonly string _databas...
I am using an Entity Framework 6 ,I have some table as a mapping tables in the database - to map many to many tables - does not created as an entity when I create the model. what is the problem will be?...that's the tables:...Prop:
PK-Code
PropCh:
PK-CHID...
I have order structure as below...Order 1234...Category 1...Item 111...Item 222...Category 7...Item 444...How can I modify the query below to include all items from order 1234...public List<Items> GetAllOrderItems(int orderId)
{
var result = (from o i...
I have an sql server database and I use EF 6.0 to access it in my app....I have the following SQL Query I need to convert to dbcontext linq to entities query and have some damn hard time figure it out....This is the query:...select
PA.Number,
PA.Name, ...