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)

189 results in tag: asp.net-mvc-4

MVC class primary key field creation

I am new to MVC and C#. I just stumbled on it and found it interesting. I encountered an issue which will not allow me proceed. Here is my code:...using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; ...
asp.net-mvc asp.net-mvc-4 c# entity-framework
asked by Peter

Cascading DropDown List in MVC 4

I have a ASP.NET MVC 4 project with EF I have a table with ...Parteners.... This table has 2 types of parteners : agents(part_type=1) and clients(part_type=2). In an Create view I have the first DropDownList that shows all my agents, a button and the seco...
asp.net asp.net-mvc asp.net-mvc-4 cascadingdropdown entity-framework
asked by Misi

Why am I getting this "Invalid object name 'dbo.*'" error with MVC4?

I get this error:...Invalid object name 'dbo.ImageMetas'....On this line:...return View(db.Images.ToList());...Where my database context looks like this:...public class GalleryContext : DbContext { public GalleryContext() : base("DefaultConnec...
asp.net-mvc-4 entity-framework visual-studio-2012
asked by mpen

SimpleMembershipProvider not working

I started a new internet project with VS2012 and am trying to just restructure my project a bit and I can't seem to keep the SimpleMemberhsipProvider working. Basically, all I've done is move the models objects into a core project along with a couple oth...
asp.net asp.net-mvc asp.net-mvc-4 entity-framework simplemembership
asked by Kyle Rogers

How to create custom additional fields in UserProfile in MVC4

I faced with new ASP MVC 4 feature, it shipped with new membership db schema and new initialization. In mvc 3 and old versions developer able to create custom user profile fields using specifications in web.config, but now i faced with method in filters n...
asp.net-mvc asp.net-mvc-4 c# entity-framework simplemembership
asked by testCoder

Entity Framework Code-First Issues (SimpleMembership UserProfile table)

If you've used ASP.NET MVC 4 you'll notice that the default for an Internet Application is to use the SimpleMembership provider, this is all well and good and works fine....The issue comes with the default database generation, they have a POCO for ...User...
asp.net-mvc-4 c# entity-framework
asked by Rudi Visser

SimpleMembership MVC 4 get data from UserProfile having role in webpages_Roles

I have the following code. But there must be a more database efficient way to do this, because, correct me if Im wrong the number of database queries is (1 + (qty of users with admin role))...With a new MVC 4 project the membership defaults are the tabl...
asp.net-mvc asp.net-mvc-4 entity-framework
asked by Marc

No connection string named 'MyEntities' could be found in the application config file

I am using entity framework and ASP.NET MVC 4 to build an application...My solution is split into two projects;...A class library that includes my data model (.edmx) file and a few custom interfaces...The 'container' MVC project that references the class ...
asp.net-mvc-4 c# entity-framework
asked by jjc99

How to map recursive relation on self in Entity Framework code-first approach

All I want to create is basic recursive category. Category is root if ...RootCategory_Id... is set to null and it belongs to some other category if it is set to some id. I've added category with two child-categories in ...Seed()... method to test and it d...
asp.net asp.net-mvc asp.net-mvc-4 c# entity-framework
asked by Stan

ASP.net MVC4 Multiselect ListBox with Many-to-Many relationship

I'm new to ASP.net, MVC4 and EF and having trouble making the leap from relatively simple samples to something (only slightly) more complex. I have simplified my model for the question here so consider the following. Forgive me if I have some of the ter...
asp.net-mvc-4 data-binding entity-framework razor
asked by CuberChase

What is the data annotation for changing nullable and not null data types?

I reckon this should be simple for experienced programmers but here it goes. I am working on a project using entity framework code first.I have also enabled migrations and set to auto (Lovely feature)....I stupidly declared one of the datatype wrong in my...
asp.net-mvc-4 c# ef-migrations entity-framework visual-studio-2012
asked by Komengem

Manage the lifetime of dbContext

I would like to tie the lifetime of a dbContext to the lifetime of a session, to - for example - be able to commit or abandon changes on a group of mutations on the dbcontext over multiple requests....Are there any other (better?) ways to accomplish this?...
asp.net-mvc-4 dbcontext entity-framework
asked by Martijn

Unique Constraint with Entity Framework using Code First Migrations

I am doing entity framework (v 5) code first migrations, on an MVC 4 application. I would like to add a unique constraint at the database level. ...I know this can be done when creating the table, but I already have a table. ...http://msdn.microsoft.com/e...
asp.net-mvc-4 code-first ef-code-first entity-framework
asked by Daryn

empty .Designer.cs file after generating .edmx using EF 4.x on ASP.Net MVC4 application

I have started a very simple ASP.Net MVC4 applictaion with a Database first approach (with existing DB). I have generated ....edmx... using ADO.Net Entity Data Model template. The process has created a ...xxxxxxx.Designer.cs... file under ...xxxxxxx.edmx....
asp.net-mvc-4 ef-database-first entity-framework
asked by shaz

When should I create a new DbContext()

I am currently using a ...DbContext... similar to this:...namespace Models { public class ContextDB: DbContext { public DbSet<User> Users { get; set; } public DbSet<UserRole> UserRoles { get; set; } public ContextDB() ...
asp.net-mvc asp.net-mvc-4 c# entity-framework
asked by JensB

Edit Id - Store update, insert, or delete statement affected an unexpected number of rows (0)

So I need to be able to edit my primary key field in my edit page for a row, I get the error...Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were load...
asp.net-mvc asp.net-mvc-4 c# entity-framework
asked by Gary Kenyon

MVC 4, EF 5 SaveChanges does not update database

I'm relatively new to this but I'm still a little embarrassed as this really should be simple......All I'm trying to do is update an existing row in a database table. I'm using EF (5 I believe) code first....For MVC 3 I used this approach (which worked):....
asp.net-mvc asp.net-mvc-4 c# entity-framework
asked by ChrisCurrie

Adding Validation Attributes With an Entity Framework Data Model

Preface Feb 2015... If you are still using Entity Framework EDMX, please do yourself a favor and checkout using Entity Framework Code First instead. The difference is that your tables are created from your model classes, rather than in EDMX where your mod...
asp.net-mvc-4 entity-framework
asked by Mason240

Entity Framework generated classes are not in the namespace I require, is there a way of changing the namespace it uses without regenerating?

If I need to regenerate where should the namespace be specified. I am trying to use partial classes from within the Models namespace however they don't match....The simplified code fragment below is where the entity framework classes have been generated..
asp.net-mvc-4 entity-framework namespaces visual-studio
asked by John Fleming

Entities Framework 6 alpha 2 - Async Patterns

I recently have a project with MVC 4, .NET 4.5 and using EF 5.0 (Database First) using the EF 5.0 DbContext Generator. I then upgraded through Nuget Manager to EF 6.0 alpha 2. I wanted to use the new async patterns but for some reason I dont have .ToLis...
asp.net-mvc asp.net-mvc-4 azure-sql-database c# entity-framework-6
asked by Joe

Page 1 of 10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • »

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!