Questions tagged [entity-framework]

2 votes
2 replies
Linq GroupBy Clause not including items with zero count
I have a query below which is supposed to group the result by Id, EntityName, DocType, Jurisdiction. For each group the query also returns the Pr...
asked 1 month ago
0 votes
0 replies
EntityFramework context doesn't retrieve any data when created in a different project
Fellow coders, I am facing a weird issue using Entity Framework and I would like to understand what the root cause of this : I have a shared...
asked 1 month ago
0 votes
1 replies
How can I “expand” IQueryable results based on a range of values?
I am trying to determine a way using Linq within the IQueryable, to "expand" an entity into multiple query results based on a range of values. S...
0 votes
1 replies
New Transaction are not allowed Entity Framework 6
In an ASP.NET Webforms application on .NET 4.0 and a Web API, I attempt to add an order and orderRow to the database, but I get this error: E...
asked 1 month ago
0 votes
1 replies
Multiplicity is not valid in Role '. the upper bound of the multiplicity of the Dependent Role must be '1'
This is the model one to many(Applicant). The(AttachedDocument) is many model I think I have the relations wrong public partial class Applicant...
asked 1 month ago
1 votes
1 replies
The required column 'id' was not present in the results of a `FromSql` operation in EFcore
I have a major problem with FromSql and that's it : I have a model like this: public partial class model { public string name } I want t...
0 votes
1 replies
EF AddRange method does not work with big data
Good morning. Today I'm facing problem with EF 6 and AddRange method. There is an WPF application which works with ~100000 records. I wrote impo...
asked 1 month ago
1 votes
0 replies
Extending DbSet Add in EF Core
Using EfCore 2.2.4 I am attempted to override the base DbSet implementation in one of my Db Contexts. I am using Oracle.ManagedDataAccess.Core 2...
-3 votes
1 replies
How to overcome “The cast to value type 'System.DateTime' failed because the materialized value is null” when enumerating a model in a view in MVC
I'm following an MS tutorial online on how to use code first MVC on an existing DB. I'm trying to display the contents of an MVC model in a view...
0 votes
1 replies
Object Foreign Property Is Not Populating
I'm new to EF so sorry if the question is ... you know. I have two entities objects; User and UserRole In the user object I have a property Use...
0 votes
1 replies
How to Navigate Database 1 by 1 using a button like a Queue System
I'm setting up A QueueSystem and I have a set of buttons of "Next", "Previous", "Transfer" and "Finish" buttons. How can I navigate my database...
0 votes
1 replies
Entity Framework intercept and modify dates
I'm modifying a .Net web system that uses Entity Framework 6.2, the problem is that whenever a user enters a date, they do it in their local time...
asked 1 month ago
1 votes
1 replies
Error while creating 1-to-1 relationship between two classes in Entity Framework
I'm trying to create 1-to-1 relationship between two classes. 1 user has 1 profile picture and 1 profile picture belongs to one user. the code i...
0 votes
0 replies
Non-static method requires a target; using Entity Framework
I have the following query resulting in the error, "Non-static method requires a target". How do I correct the error and get the data? There is...
asked 1 month ago
1 votes
1 replies
How to map SQL_VARIANT in Entity Framework Core 2.1?
In core 1.1 I used the TypeName = "sql_variant" attribute on the property and it worked. [Column("tx_value", TypeName = "sql_variant")] public...
asked 1 month ago
0 votes
0 replies
Database Design with Asp.Net Core Identity One-to-Many & One-to-One Relationship
I am running into a little bit of an issue with my table design with Asp.Net Core Identity. As of right now I have a User table which inherits fr...
0 votes
0 replies
Unable to determine a valid ordering for dependent operations when adding a object
I have shown the Customer Model below, In that model the company and parent attribute is also a customer type, when building all the migrations w...
0 votes
0 replies
I want to integrate shuftipro api for user validation in MVC entity framework
i am new to mvc, i got task to integrate shuftipro api that is used for validating user identity like pic, doc etc. I need to do in MVC entity f...
0 votes
0 replies
StackOverflowException in EntityFramework.dll when fetching large amount of records from database
I am facing a problem with entity framework. I am reciving an array of ints, and than I fetch these records from database using this code. var i...
asked 1 month ago
0 votes
0 replies
Next and Previous Button to navigate my database
I have A "Next" button that when click, will show the first data from my datastore. I'm stuck to the thing that I want to accomplish, I need to r...
1 votes
0 replies
Can EntityFramework.dll run in GAC?
I want tranfer all public dll's to GAC, because I have many projects in one computer with other folders (services, applications). I need to re...
asked 1 month ago
0 votes
1 replies
How to correctly store a number of results in a DTO?
I have stored procedure attached to a DB which should return results from just a simple search. The query is added to my entity and calls a regul...
-1 votes
1 replies
Introducing FOREIGN KEY constraint “XXX” … Could not create constraint or index
I'm setting up a new e-commerce project. I want every category has many sub category and these sub categories has many products in it. My product...
asked 1 month ago
0 votes
0 replies
How to cancel all the unsaved data in the context? when using EF6
Hello I have a UI like this so What I want to do is: If I press the x button and close the form I want to undo all the changes on this record....
asked 1 month ago
0 votes
1 replies
The entity type 'xxx' requires a primary key,but i already defined it?
My entity is derived from Entity class, so it should by default have an id of type int, but for some reason EntityFramework does not recognize it...
asked 1 month ago