Tagged Questions
0
votes
0answers
37 views
Database not updated using repository pattern and EF Code First
I've got an layered design in my webapplication with an generic service and repository construction. I want to use code first so I can code my entities and then create/update my database. However I ...
0
votes
1answer
15 views
MVC Code First referencing existing table getting error {“Invalid object name 'dbo.TableNames'.”}
I am new to MVC 4 and Entity Framework, but have successfully been able to create new tables using migration, as well as seeding them. My problem is now I need to access a table in the database, that ...
0
votes
0answers
23 views
Change Constraint Names using an Entity Framework Migration
I have built a database using EF Codefirst (In an MVC4 application).
I've since learnt, that an external tool that will access this database has name-length limitations for columns & constraints.
...
0
votes
1answer
25 views
Allow null in model when using Code first
I have an model like this:
public class EquipmentEmployee
{
public int EquipmentEmployeeID { get; set; }
public int EmployeeID { get; set; }
public Employee Employee { get; set; }
...
2
votes
2answers
43 views
MVC4 model property should be a list or an ICollection of another class
I'm making a type of test-generation application using Entity Framework code-first. I have a base class called Question, from which MultipleChoiceQuestion, EssayQuestion, and other question types ...
1
vote
1answer
39 views
The term 'Enable-Migrations' is not recognized mvc code first
I'm trying to run for the first time in my new mvc 4 application
PM> Enable-Migrations –EnableAutomaticMigrations
I'm geting:
Enable-Migrations : The term 'Enable-Migrations' is not recognized ...
0
votes
1answer
26 views
EntityFramework Code First automatically setting the value of a public property
I am building a ASP.NET MVC 4 app that will allow users to upload a lot of images to the server. With each image certain entities will be associated, like the Product entity will be associated with ...
1
vote
1answer
63 views
Adding “key” attribute to properties in a base class in MVC 4 for Entity Code First
I have a .dll with a class in it, which contains a list of objects (this is from metadata, I don't have source code):
public class APIKeyInfo
{
public APIKeyInfo();
public long AccessMask { ...
0
votes
0answers
36 views
MVC-4 Assigning Employees and Manager to Department Scenerio and EF-CodeFirst
I have a Department Table with Fields
public class Department
{
[ScaffoldColumn(false)]
public int DepartmentId { get; set; }
[Required(ErrorMessage = "*")]
...
0
votes
0answers
104 views
Role assignment using SImpleRoleProvider in ASP.NET MVC 4
I've implemented a customized version of SimpleMembershipProvider with custom table structures. The webpages_Membership table has been bypassed due to the use of an external authentication provider. ...
1
vote
0answers
59 views
Using EF to connect with existing Database
I had a project which contains a Database(SIS.mdf) in its App_Data folder.
Now I have a new MVC4 project. I manually added that database to my new App_Data folder by add existing item option on right ...
0
votes
0answers
30 views
MVC4: model backing the 'SisContext' context has changed since the database was created. Consider using Code First Migration to update database
I asked this question before as well but I'm posting it again, hoping may b i can get help
Here it goes
When I try to Login with details that are available in database(SIS) I get this error.
The ...
1
vote
0answers
33 views
Deploying codefirst is not creating all table fields
Im having some issues trying to deploy a code first based mvc4 application to azure.
It works fine when creating a localdb however when trying to deploy to azure the UserProfile table only Username ...
1
vote
1answer
99 views
“Object reference not set to an instance of an object” when creating a new Web API controller with EF Scaffolding in Visual Studio 2012
I have an MVC4/Web API project, with an Entity Framework, Code First data model. When I try to create a new API Controller with read/write methods using a data context & model, I get an alert ...
1
vote
2answers
47 views
One-to-one relationship in CF Entity Framework using mapping
I'm using Entity Framework 5, Code-First.
I've two domain objects (or tables). 1st is User, and 2nd is UserProfile. One user can have only one profile, and one profile belongs to only one user. That ...