entity-framework-5 Questions
6
Solved
I'm using .NET 4.0, MVC3, and EF5 with code first.
My solution is split up into three projects, with the dependencies as indicated:
Project.Web -> Project.BLL -> Project.DAL
The Project.DAL laye...
Disposal asked 23/10, 2012 at 13:48
4
Solved
I'm mapping up data from an SQL database into an object in c#. The problem is, one of the columns is unfortunately named "100_hrs". So when I am making my C# object, I get an error in the declarati...
Entablature asked 15/4, 2013 at 5:6
7
Solved
I'm trying to create a unit test for my service with a mocked DbContext. I created an interface IDbContext with the following functions:
public interface IDbContext : IDisposable
{
IDbSet<T>...
Cristionna asked 21/9, 2014 at 14:24
4
Solved
I am new to EF5 Code First and I'm tinkering with a proof-of-concept before embarking on a project at work.
I have initially created a model that looked something like
public class Person {
publ...
Grader asked 12/2, 2013 at 16:28
3
Solved
I am using Entity Framework 5 code first. My table has a column called Active and its datatype is of type int. The values that are stored in Active are 0, 1 and null.
I have a class that I need to...
Giesecke asked 7/3, 2013 at 9:39
9
Solved
I have a controller action that works fine on Firefox both locally and in production, and IE locally, but not IE in production. Here is my controller action:
public ActionResult MNPurchase()
{
Ca...
Skyros asked 5/12, 2012 at 6:11
8
Solved
I have created a migration using the Add-Migration command, but I'd like to change the name of that migration. How can I undo the migration command, so that I can regenerate it using the new desire...
Nystrom asked 23/1, 2014 at 15:13
19
Solved
The strange thing is, it was working fine a few days ago. I added a new column to a table and was going to update the model through the designer and now it says "The Entity Data Model Designer is u...
Reliquiae asked 14/2, 2013 at 20:53
10
Solved
I renamed a a couple entities and their navigation properties and generated a new Migration in EF 5. As is usual with renames in EF migrations, by default it was going to drop objects and recreate ...
Kreindler asked 8/11, 2012 at 20:12
8
Solved
I am using MVC 4 and entity framework 5.0, i have a database and this database contains 6 tables named as following.
tblUser_family
tblUser_location
tblUser_info
tblUser_photo
tblUser_settings
tbl...
Plainspoken asked 25/5, 2015 at 5:1
4
Solved
I'm a bit stumped. From what I've read setting the DbContext.AutoDetectChangesEnabled to false should disable change tracking requiring one to call DbContext.DetectChanges in order to identify chan...
Underplot asked 31/5, 2013 at 18:13
28
I am using EF5 beta1 and while I was able to run the "Update-Database" before. Now that I shut down Visual Studio, I cannot get it to run. I get the following error:
The term 'Update-Database' i...
Bramblett asked 12/3, 2012 at 21:20
12
Solved
I recently upgraded to Visual Studio 2012 RTM Ultimate from MSDN. I'm using EF Code First Migrations to build my database in my app, and I recently added a new entity and want to scaffold the migra...
Trimolecular asked 19/8, 2012 at 17:23
5
Solved
I know some differences of LINQ to Entities and LINQ to Objects which the first implements IQueryable and the second implements IEnumerable and my question scope is within EF 5.
My question is wh...
Motherwell asked 31/7, 2013 at 10:56
11
Solved
If I do any changes to my EF 5.0 model, VS does not seem to see the changes. I have tried adding a new table, which shows up fine in the model, but then if I try to use it somewhere the table does ...
Irreformable asked 19/11, 2012 at 19:39
5
Currently working on an ASP.Net MVC 4 application using Entity Framework 5. Used CodeFirst for initial development phase. But have now disabled the Automatic Migrations and designing new tables dir...
Champlin asked 9/6, 2013 at 17:35
9
Solved
I have been exploring different methods of editing/updating a record within Entity Framework 5 in an ASP.NET MVC3 environment, but so far none of them tick all of the boxes I need. I'll explain why...
Requital asked 11/3, 2013 at 10:27
7
Solved
Ok, I have tri-leveled entities with the following hierarchy: Course -> Module -> Chapter
Here was the original EF LINQ statement:
Course course = db.Courses
.Include(i => i.Modules.Select(s ...
Congo asked 2/4, 2013 at 12:51
28
Solved
I'm working with EF5 in a MVC 4 aspnet website.
Locally, everything works just fine, but when I publish it to the IIS and try to enter, I get the error
"The type initializer for 'System.Data.Ent...
Pifer asked 11/7, 2013 at 5:23
4
Solved
In Entity Framework 5 model first, there seem to be some breaking changes due to the way the class files are generated (No more code generation, but T4 templates)
2 examples:
The generated cont...
Seigniorage asked 20/9, 2012 at 7:39
8
Solved
I am creating asp.net mvc4 sample.In this i created Id column as GUID in Sample table of datacontext.
public class Sample
{
[Required]
public Guid ID { get; set; }
[Required]
public string Fi...
Lanham asked 13/8, 2013 at 4:42
3
Ok, I want to recreate a project that I created using EF 4.1 to EF 5.0, simple enough or at least I thought. One of the things in my old project is that I was able to change the database connection...
Cai asked 4/10, 2012 at 23:7
8
Solved
ASP.NET MVC 4, EF5, Code First, SQL Server 2012 Express
What is best practice to enforce a unique value in a model? I have a places class that has a 'url' property that should be unique for every ...
Deterrent asked 21/5, 2013 at 20:9
2
Solved
I have a big database existing database to comunicate with, and I'm using EF 5.0 database first, the problem I'm having is that if I create any data decoration like [stringlength(50)] on the class ...
Josefinejoseito asked 19/7, 2013 at 11:8
2
Solved
How to enable migrations in a class library project?
I'm building a project using Code First EF5. I want to separate the data and the mvc web project by adding a class library project.
Right now ...
Snipe asked 30/4, 2013 at 15:2
1 Next >
© 2022 - 2025 — McMap. All rights reserved.