Tagged Questions
The ADO.NET Entity Framework is a set of Object-Relational-Mapping (ORM) tools for the .NET Framework, and was first made available with .NET 3.5 SP1.
1
vote
2answers
11 views
Retrieving 10 records from Oracle materialized view in Entity Framework VERY slow
I am building an ASP.NET MVC 5 application to get read-only access to a few records at a time (Roughly between 2 and 12 rows). The records are stored in Oracle 11, and accessed via Entity Framework 6, ...
0
votes
0answers
17 views
ASP.NET WebForms application trying to create a database
Why is my WebForms app accessing entity framework to create a database? I have removed all references to EF in my code and web.config. I'm trying to use InProc session state. But when my session ...
-1
votes
0answers
4 views
Entity Framework temporal table
I'm looking for samples or some Guidelines how to implement temporal data / tables in EntityFramwork. Its not a Problem to filter the data / narrow down to the relavated current values, but how to ...
0
votes
0answers
8 views
ASP MVC EF6 Multi Tenant based on host
Sorry, another multi tenancy post. I can't find a good solution to site, I have read tons of great posts on multi tenancy for ASP MVC but I still need some good advice.
I have an ASP MVC Entity ...
0
votes
0answers
16 views
.net core websockets obtain DbContext
I am testing out .net core and making a small sample app using .net core + websockets to push some data into my app. I want to save this data in the database using a dbcontext.
However I have issues ...
0
votes
1answer
15 views
With Symfony, how to query entities according to user roles?
Let's say I have a Book entity with a field $grantedTo, filled with a User Role.
This field allows to grant or deny access to a book according to the user roles.
Let's consider another entity called ...
0
votes
0answers
13 views
Issue after creating identity ICollection
i am trying to use Entity Framework to set up a 1-to-many relationship using the built-in Identity framework.
My 2 models look like this (with unneeded attributes removed)
PropertyModel
[System....
0
votes
0answers
22 views
Can someone explain to me what this Expression Tree code is doing?
I'm having a lot of difficulty understanding this code, especially since I'm pretty new to both using Expression Trees and using Reflection.
foreach (var table in myContext.GetType().GetProperties()
...
0
votes
1answer
34 views
Update mutiple records in database MVC 5 EF
Good evening,
Now I'll describe my situation:
Here is my Model:
[Table("Items")]
public class Item
{
[Key]
public string Id { get; set; }
public DateTime Generated { get; set; }
...
0
votes
1answer
27 views
Multiplicity error in one to Many Relationship
I have multiple entities nested together and when I try and Add the survey class I get the error
Multiplicity constraint violated. The role 'Response_Pages_Source' of the relationship '...
1
vote
1answer
16 views
How do I point to my full SQL Server Express database in ASP.NET Core project?
Context
I have an existing project which is a data access layer that connects to a local SQL Server Express 12 database.
I now want to create a new ASP.NET Core project in the same solution which ...
0
votes
0answers
20 views
How to do things properly with MVC, Automapper and Entity Configuration's constraints (IsRequired)?
I'm currently facing an issue with MVC, Automapper and Entity Configuration, and I need your help !
I've been searching it for a while but did'nt find anything about it...
Actually, I have three ...
1
vote
2answers
31 views
ASP.NET Core EF Code First appsettings.json
I'm looking for a method to switch dynamically between production and test environment.
I have two different connection strings to MSSQL databases. I want to dynamically pass this to my dbContext:
...
0
votes
1answer
20 views
how do I show a loading window in WPF while performing Entity Framework operations with 1 DBContext?
I have an application in WPF (MVVM) and in my viewmodel I need to save some new entries. This is a large application with several tabs and uses 1 central database context (EF 5).
When saving the new ...
-2
votes
1answer
56 views
EF Lambda .where() if statement not working? [on hold]
I'm trying to place and if statement in lambda.
Does not work
var artidfilter = true;
var mynewlist = _context.sometable
.Where(c => (artidfilter) ? c.Articles.Id.Equals(1) : c....
1
vote
0answers
6 views
The entity type ApplicationUser is not part of the model for the current context solution
So for school I got the task to make an API so you can login on a database and after you logged in, you can access some data. To login, we're using AspNetUsers made from another project that uses MVC. ...
0
votes
0answers
14 views
Automapper child mapping with entity in the middle
I have the following entity structure that I want to map to a Dto
Context Entities
public class CallPoint
{
public int Id { get; set; }
public string Name {get; set;}
public ICollection {...
0
votes
0answers
10 views
Migrating Database in a N-Tier Application with Entity Framework Codefirst
I'm trying to create database with Entity Framework Code first approach in my layered project structure. I use standart code-first console commands;
enable-migrations => ok
add-migration Init => ...
1
vote
0answers
18 views
connect to PostgreSQL 9.5 database from Visual Studio 2015 via Npgsql
I installed NpgsqlDdexProvider-3.1.0, through NuGet added to the project packages Npgsql v.3.0.5, EntityFramework5.Npgsql v.3.0.5, EntityFramework v.5.0.0. I try to add connection to database via ...
1
vote
0answers
15 views
EF Core - Add new tables to database During Runtime
I have an asp.net core project which needs to be able to support plugins at runtime, and as a consequence, I need to generate database tables based on what has been plugged in. The plugins are each ...
1
vote
0answers
33 views
How can I remove, add and update using Entity Framework in single method
I have Parent-Children structure in one of my functionality. I am using EF6.
I am able to add/update children records successfully but want to delete some of children records from db that got deleted ...
1
vote
1answer
12 views
Filter by DateTime Range MVC 5
Good evening everyone,
I home, anyone can help my with Date time range filter on view part.
Here is my model:
public class IndexVM
{
public DateTime? StartDate { get; set; }
public DateTime? ...
0
votes
0answers
9 views
How to export all EF EntityTypeConfiguration mapping lasses to a csv file with the mapping details of each properties using reflection in C#?
Sample Class:
public class DocumentMap : EntityTypeConfiguration<DocumentEntity>
{
public DocumentMap()
{
// Primary Key
this.HasKey(t => t.ID);
// ...
-1
votes
1answer
38 views
What are the assembly types with name <>c? [duplicate]
I'm loading some assembly types of my Entities and some of then appears with this value "<>c" in the name
what are these types? And how do I ignore them? (whitout load it) If i need...
1
vote
2answers
39 views
ASP MVC List of Users and Roles
I'm developing an application in ASP.NET MVC 5 and I'm using Entity Framework. I am using the template project that is provided in visual studio as the start to my own project. I would like to be able ...
-1
votes
0answers
22 views
Edit function is not in Entity Framework 6
HI gay's I am new to MVC 5 application development, I need help, I have the following Controller:-
public ActionResult Approve(int id)
{
try
{
var ...
0
votes
0answers
7 views
Where to loop when modifying data table entities in a layered architecture using EF6… in business or data layer?
At the moment I am studying EF6 and three layered architecutre (presentation, business, data), and I have a dilema when it comes to working with "all" entites of a data table, for example updating a ...
-1
votes
1answer
17 views
Popup in Listview
I have a Listview which consist of field called description(Which can be lengthy)
now i want to set read more and when user click on read more it should give full description in popup.
Code Designing ...
0
votes
0answers
19 views
Entity Framework store specific json data
What is easiest and correct way to store received json data (received by MVC controller)
This is received JSON object..
"device":"deviceID",
"createdAt": "2016-12-8T19:20",
"data":{
"streamName1"...
1
vote
1answer
31 views
Using navigation properties instead of LINQ Join in WebApi controller
I am using Entity Framework Code First and LINQ to Entities in a Web Api Controller.
I have 3 tables that are related with the following relations/ navigation properties: (the model classes are as ...
0
votes
0answers
7 views
Using Microsoft Rolemanagement vs Cusom Rolemanagement Db Structure and Logic
In my company we use our own way of managing users and role management because of what i have heard and not used (Microsoft Role management) does not support multiple systems, multiple roles and ...
0
votes
0answers
45 views
Linq to SQL and ADO.net
I have databae and tables now in viual studio first i try to work with LINQ to SQL so when i select add new item then LINQ to SQL then DataClasses1.dbml file is created so with the refrence of this i ...
0
votes
1answer
50 views
The linq query in Entity Framework is too slow
I am using EF6 (model-first) that connects to Oracle 11G.
I have 3 tables A,B,C, and I defined the right FK to get the relationships:
1. B is a child of A.
2. C is a child of B.
Now, I'm running ...
0
votes
1answer
8 views
Why is Entity Framework ConcurrencyStamp not using ROWVERSION/TIMESTAMP?
I am new to EF and previously engineered custom ORMs that use TIMESTAMP fields for concurrency and also determining records for synchronization to other databases.
Why does EF (Core) use nvarchar(max)...
-1
votes
0answers
22 views
How we can exclude required fields when update state in Entity Framework
I want to learn how to manage required fields when using one edit method to add and update entity.
For example
I have an entity which has one or more required fields:
[Table("Users")]
public ...
1
vote
2answers
22 views
How to use RemoveRange with 1-query-approach Entity Framework 6
I look for a way of executing RemoveRange() with 1-query-approach. With Remove() method it works like this:
public void Delete()
{
Record record = new Record() {
id = 1,
value = 5
...
0
votes
1answer
16 views
How to set value in ViewModel asp.net mvc 5? [duplicate]
I have the below ViewModel in which I want to set value of Id and Name
I get the error
"Object reference not set to an instance of an object."
Controller Code Snippet
var viewModel = new Class1()...
0
votes
1answer
18 views
EntityFramework core model relationship issue while doing Add-Migration
I am facing an EntityFramework core model relation issue while doing migration using Package Manager Console in a asp.net core project.
Getting below error while adding migration "Add-Migration".
...
0
votes
1answer
6 views
Loading Parent Child data using Entity Framework stored procedure
I have two stored procedures, one to load parent data and other to load child data. Is there anyway to do this in a better way? Please see code below.
public partial class Product
{
...
-1
votes
0answers
15 views
CREATE DATABASE permission denied in database 'master' on GoDaddy SQL Server Portal
I recently deployed an MVC website and I’m using godaddy for hosting. I setup the database using their SQL Server portal. I can see data. My problem is when I try to login or register. I’m having ...
0
votes
0answers
29 views
LINQtoSQL vs LINQ to Entity
Why use LINQ2SQL to bind to ComboBox do not use method ToList(). But LINQ to Entity database first to bind to ComboBox must use method ToList()
use LINQ2SQL
DataClasses1DataContext data = new ...
0
votes
0answers
17 views
Add existing table in database to entity, do not see .edmx file anywhere
I right-clicked on my project, added a new Data item: ADO.NET Entity Data Model, named it and pointed it to my local database, selected all the tables and the wizard created several classes that ...
-3
votes
1answer
37 views
How to call function Entity Framework
I am trying to call function called connectUser that takes 2 arguments, name and password and returns id (number)
The problem is that it does not work and I am getting the NotSupportedException ...
4
votes
2answers
64 views
How to compare just month and day from a datetime object
In my C# program I have run into an obstacle where I have a table that stores date ranges (columns are date range ID (int), begin date (DateTime) and end date (DateTime). I want to query the table and ...
0
votes
0answers
13 views
EF Core and stored parameter return values, is there another way besides ADO.NET?
If I have a stored procedure defined and deployed like
CREATE PROCEDURE [dbo].[IceBreaker]
@param1 int = 0,
@param2 int
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
SELECT 123;
RETURN 0
...
0
votes
0answers
21 views
Entity Framework: how to specify a nonclustered index for model
Good day. I want to specify nonclustered index for increase search speed for this table:
create table Staff(
Id int identity(1, 1) primary key,
FirstName nvarchar(50) not null,
LastName ...
2
votes
0answers
36 views
Dynamic Linq where clause throws OutOfMemoryException
I am a novice at Linq and a true beginner with expression trees.
I have a generic expression routine that builds a simple Linq where clause that I found at:
https://www.simple-talk.com/dotnet/net-...
-2
votes
2answers
18 views
multiple values in one field using Linq IN ASP.NET MVC project [on hold]
I am developping an asp.net mvc application using entity framework code first approach.
I have table student with 2 columns :
id name
1 n1, n2
2 n11 , n22
I want to search ...
2
votes
1answer
33 views
Why use Attach for update Entity Framework 6?
While searching for the best practivies of performing CRUD operation via EF I noticed that it is highly recommended to use Attach() or Find() methods before updating an entity. It works well and ...
0
votes
0answers
13 views
How do I make adding rows to MySQL with EntityFramework faster?
I have a SaveQueue() task which I use for saving images to the database:
async Task SaveQueue()
{
for (;;)
{
try
{
await Task.Delay(7500);
dbUpload....