zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

23 results in tag: model-view-controller

Create a new Model or utilize an Entity Framework class in ASP.NET MVC.

I am developing a ASP.NET MVC 3 application, i am using entity framework code first in order to create the classes of my app, and i also have a repository in order to perform the operations on it, keeping clean the DBContext and the DBEntities definitions...
asp.net-mvc design-patterns entity-framework model-view-controller
asked by juan25d

Get data from the database using mvc

I am trying to retrieve data from the database and populate the records in a table, but i am getting an error ...An exception of type 'System.NullReferenceException' occurred in App_Web_14paz0pq.dll but was not handled in user code Additional information:...
asp.net-mvc c# entity-framework model-view-controller
asked by user3290332

Attaching an entity of type failed because another entity of the same type already has the same primary key value.

Let me quickly describe my problem....I have ...5 databases... for 5 customers and ...each has the same table called SubnetSettings.... ...I already created a dropdownlist to select a customer and will shows up the SubnetSetting table which belong to sele...
c# entity-framework model-view-controller primary-key
asked by user3618052

MVC Drop Down list with entity framework

I've created an MVC project using entity framework code first. My model is simply a form that gathers information. ...public class Application { public int Id { get; set; } public string FirstName { get; set; } public string MiddleInitial { ...
asp.net-mvc entity-framework model-view-controller
asked by dc922

Can I create a mock db context which I can add to, then search?

I have a simple document manager which is injected into my controller in an asp.net c# MVC project. The project is database-first and the ...Document... table is indexed by ...documentId..., an auto incrementing integer. ...I have been trying to write a t...
c# entity-framework mocking model-view-controller unit-testing
asked by jonaglon

MVC 5 using EF6: Initial page load super slow

I'm trying to figure out what the problem is and I think its related to me not caching any of the DB calls. Essentially what I have is an MVC5 application using EF and plenty of LINQ to make DB calls. ...The site is www.techiejs.com ...The first load s...
c# entity-framework-6 model-view-controller razor
asked by Spets

Entity Framework The context cannot be used while the model is being created

My unit of work class is mentioned below and I am using Ninject and I have tried injecting ...IUnitOfWork... per request per thread scope, transient etc. but I am still getting error which is:..."Message":"An error has occurred.","ExceptionMessage":"The c...
asp.net-web-api entity-framework-6 model-view-controller multithreading
asked by Salman

There is no argument given that corresponds to the required formal parameter 'context of GenericRepository<Incident>.GenericRepository(dbContext)

I am getting this error message which when trying to inherit from my GenericRepository. The error says I need to also provide a context but I am not sure how? ...//IncidentRepository public class IncidentRepository : GenericRepository<Incident> //Generi...
entity-framework model-view-controller repository-pattern
asked by ASPCoder1450

how to get top 5 records in linq with lambda expression

I need to get top 5 values of one column "Tempreture" at this time stamp like "select top 5 temperature of the tbl_sensors order by desc " ...I tried like this, but I don't know how to get top 5...var sensorsVal = DB.tbl_sensors.OrderByDescending(x => x.C...
c# entity-framework-6 linq model-view-controller
asked by rahul kumar

How to run code-first migrations to multiple tenants (separated by schemas)

We are developing a scholar system witch is a multi-tenant application using entity framework 6 MVC and ...CODE FIRST MIGRATIONS... and that's the problem, our multi tenant uses schemas (Sql server 2012+) to separate the data but all the migrations are be...
c# ef-migrations entity-framework-6 model-view-controller multi-tenant
asked by gabriel.santos

Can Dapper be used to produce controllers and views automatically?

I am working with dapper with c# and mssql . Is there any way that we can autogenerate Controllers and views with dapper as we do with EF....I thought ...DapperExtensions... will work as they specified ...A small library that complements Dapper by adding ...
.net crud dapper entity-framework model-view-controller
asked by techbhalla videosgeek

Insert data into multiple table in entity framework

I have 2 tables like below. am using DB first approch...public class Team { public long Id { get; set; } public string Name { get; set; } public string Description { get; set; } } public class Employee { public long Id { get; set; } p...
entity-framework entity-framework-6 model-view-controller
asked by Venki

what 's the use of creating a metadata class and a partial class for the model class c#

I just joined a new company and my manager just joined too, and he wants to change the way we program. basically do what he does. I'm wondering what's the difference, pros, cons, limitation and problems if there'll be any..here's the sample ...namespace M...
ado.net-entity-data-model c# entity-framework-6 model-view-controller
asked by CyberNinja

Create a Class for extend Model Classes in EF code first

I have a model class that has for example 3 properties and corresponding table in my data base. ...public partial class Person { public string prop1 {set; get;} public string prop2 {set; get;} public string prop3 {set; get;} } ...Now I want de...
code-first ef-code-first entity-framework entity-framework-6 model-view-controller
asked by Arian

Can't find ADO.net Entity Data Model template in VS2017

I was trying to create an ASP.NET MVC web application in Visual Studio 2017. I need to take an EF database-first approach for the work....Unfortunately I can't find the ADO.NET Entity Data Model template in my "Data" template folder:...I have tried follow...
.net asp.net-mvc entity-framework model-view-controller visual-studio-2017
asked by Sandaru

Migration: No DbContext was found in assembly

Using VS Community 2017. I have tried to create initial migration with error message saying: ...Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework\Add-Migration' for Entity Fr...
c# dbcontext ef-migrations entity-framework model-view-controller
asked by cembo

When I execute my sp GetAllUsers in Dapper, why do I get a sequence contains no matching element error?

Hello my question is I have 2 table one is User table the other one is CustomerUsers I select them by Deleted=0 When I try to list all users and have customerId, I am having issue that sequence contains no matching element error... My Code is below any he...
.net c# dapper entity-framework model-view-controller
asked by phantasmagoria1985

Saving JSON received through a controller to the database MVC

Hi guys I have started to use visual studio from about 4-5 days now, I had a lot of doubts, Thanks to the Stack Overflow Community I have gained a bit more knowledge. I am trying to POST JSON to the controller and save it to a database using Model Bindin...
asp.net asp.net-mvc c# entity-framework-6 model-view-controller
asked by Abhilash Gopalakrishna

c# Lambda Query fetching one of the property weirdly null

[HttpGet] public ActionResult SecondMission(string Id) { CATSDDEntities db = new CATSDDEntities(); db.Configuration.ProxyCreationEnabled = false; var setAlet= db.Setalets.Where(x => x.Aletler.Barkod == Id && x.Bolum == ...
asp.net c# entity-framework entity-framework-6 model-view-controller
asked by Sameer Kamran

Entity Framework implement Code first Migrations and prevent data loss

I would like to know what would be the best guide to follow and things to consider if i would want to Add Migrations to a Project and note that the project:...is live (dev/staging/production environments)...Model of the live versions has changed and some ...
data-loss ef-migrations entity-framework-6 model-view-controller
asked by Dimitri

Page 1 of 2
  • 1
  • 2
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!