I am using EF 6 (code first with migrations) for MVC 5 project. On my local DEV machine everything works fine....But when I deploy my project to Azure, I get the following error when my app first tries to interact with the database:...Migrations is enable...
I have a many to many relationship between cars and many other tables. In my view I want to be able to have a multiselect list for items such as lights. I've tried many different formats I can't seem to get the list to set selected items.My preferred way ...
I'm currently working on my own simple CMS using MVC to familiarize myself with MVC and EF. ...At this time I've only got pages which can contain multiple paragraphs. In the database I've got 1 page (Home) and 1 paragraph. ...On the index view of home I'm...
Using Asp.net 4.5 and VS 2013, I would like to know how to integrate Asp.Net Identity Tables with an existing database....So basically I would like to have db tables for Identity and my own tables in the same db....I know Asp.Net Identity use Code First a...
On what basis should one decide to use ...IdentityDbContext... versus ...IdentityDbContext<ApplicationUser>... in an ASP.NET MVC5 application?...What benefits do we get by using ...IdentityDbContext<ApplicationUser>... instead of the non-generic ...Identi...
I need to make a set of checkboxes where a user can select 1 or more markets. I would normally use a set of boolean values to accomplish this as it would be pretty strait forward and in my mind not take up much space in the database or take that long to l...
I have a class that seed the database which add 2 users with roles and custom fields. The problem I have is that it save the data in [dbo].[AspNetUsers] instead of [dbo].[IdentityUsers]. Both tables are created. When seeded, the data go into AspNetUser. W...
I am using Entity Framework 6 and I have a repository looking like the following with the Add and Update methods removed to make it shorter:... public class GenericRepository<T> : IRepository<T> where T : class
{
public GenericRepository(DbContext dbC...
Is is possible, to get the new value of RowVersion using the same DbContext, without reloading the entity from the database?...Scenario:...Load data into editor form...Save new values...The row in the table gets updated, new value of RowVersion is generat...
Does an EF6 table used for many to many require a primary key and do I have to create a class for that many to many table? I have seen two ways of creating a many-many table now. The one that's been answered here in this question:...How do I name a many-m...
I have two classes:...public partial class ObjectiveDetail {
public ObjectiveDetail() {
this.SubTopics = new List<SubTopic>();
}
public int ObjectiveDetailId { get; set; }
public int Number { get; set; }
public string Text { ge...
I have the following EF data statement :...class Model1{
public Int32 Id{ get; set; }
public string Prop1 { get; set; }
public string Prop2 { get; set; }
public string Prop3 { get; set; }
public virtual Model3 PropModel31{ get; set; }...
I have a project of intern website for my company.
I use MVC5 with Entity Framework 6 on a Code First project....It's an Intranet for my company so I want two database.
1 in production (release).
1 in dev (Debug)....I've edited the Web.config, Web.Debug.c...
I'm new to EF6, its a side project for me and I'm struggling to see how to delete / modify child rows. I'd normally hand crank this stuff but I'm investigation increasing productivity....I have the following providing JSON to my knockout model....public J...
My application is using SQL Server 2012, EF6, MVC and Web API. ...It's also using a repository and assorted files such as:...DatabaseFactory.cs
Disposable.cs
IDatabaseFactory.cs
IRepository.cs
IUnitOfWork.cs
RepositoryBase.cs
UnitOfWork.cs
...We already u...
How can I inject my dbcontext into the service layer with the Unity IOC. In particular I want to be sure that I only have the one dbcontext and I want to ensure this is destroyed at the right time even if I am using async....My application uses EF6 and a ...
I need a view-model in my ASP.NET MVC 5 project, but when I added one to the models folder, a new entity was added to the database and I was forced to add a migration and update my database. I do not want this to happen, as it is a view-model I am adding ...
I'm using ...Identity2.0... with ...MVC5...CodeFirst... I have extended both the ...IdentityUser... and ...IdentityRole... like this:...public class ApplicationUser : IdentityUser
{
[Required]
[StringLength(50)]
public string FirstName { get; ...
This has no problems:...public class ApplicationUserStore : UserStore<ApplicationUser, ApplicationRole, string, ApplicationUserLogin, ApplicationUserRole, ApplicationUserClaim>
{
public ApplicationUserStore(MyAppDb context)
: base(context)
...
I am apparently having a real devil of a time understanding Entity Framework 6 which I am using with ASP.NET MVC 5....The core of the matter is that I have a really quite simple data model that is typical of any real world situation where I have various b...