ASP.NET MVC 4에서 작업하고 Entity Framework 5 프로젝트에 별도의 클래스 라이브러리를 만들었습니다. 해당 참조를 추가했습니다. EF 프로젝트 (클래스 라이브러리) 내 MVC 웹 프로젝트에 ..오류 : 'DbSet <..> 속성을 추가하기 위해 수정할 수 없습니다 - MVC4 및 EF 5
EF : Schema First
내 .EDMX
모든 테이블을 당기는 접근 방식으로 작업.
EFModel.edmx :=>
EFModel.tt
>>>Address.cs
>>>Requester.cs <<<=== (I'm working on this particular model object)
<<<More...>>>
샘플 Requester.cs 자동 생성 된 코드 템플릿 위로 MVC 프로젝트에
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace issoa_ef
{
using System;
using System.Collections.Generic;
public partial class requester
{
public requester()
{
}
public int Id { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public Nullable<bool> Active { get; set; }
public Nullable<int> CreatedById { get; set; }
public string CreatedBy { get; set; }
public Nullable<System.DateTime> CreatedDateTime { get; set; }
public Nullable<int> ModifiedId { get; set; }
public string ModifiedBy { get; set; }
public Nullable<System.DateTime> ModifiedDateTime { get; set; }
}
}
: 나는 Requester
하지만 짧은 버전 모델 클래스를 생성 한
MVC==> Model==> Folder
의 이유는 MVC Model 폴더에서 만들었 기 때문에 데이터 주석을 가지고 내 소품에 데이터 속성을 지정할 수 있습니다.