빈 빈 녹아웃 클라이언트 모델을 만들어서 쓸 필요가없는 비계를 갖고 싶습니다. 이것은 내 요구에 맞게 디자인 타임에 수행 할 수 있습니다. knockout.mapping.js 플러그인을 사용하지만 클라이언트 측에서 빈 모델 정의가 필요하고 매핑 플러그인이 실제로이 문제를 해결하지 못합니다..NET C# 모델에서 Knockout.js 스캐 폴딩
Visual Studio 용 스캐 폴드가 있는지 아는 사람 있습니까? 그럴 경우 많은 시간을 절약 할 수 있습니다.
그냥 명확하게하기 위해 나는이 C#
public class DocumentClient
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long DocumentClientId { get; set; }
public virtual long DocumentId { get; set; }
[ForeignKey("DocumentId")]
[JsonIgnore]
public Document Document { get; set; }
public long ClientId { get; set; }
[ForeignKey("ClientId")]
[JsonIgnore]
public virtual Client Client { get; set; }
public ClientRole ClientRole { get; set; }
}
이런 일을 내가 내가 NuGet 패키지를 본 적이 맹세 할 수
function DocumentClient(documentId, clientId, clientRole) {
var self = this;
self.DocumentId = ko.observable(documentId);
self.ClientId = ko.observable(clientId);
self.ClientRole = ko.observable(clientRole);
}
왜 코드 생성기를 구현하지 않습니까? 정말 간단해야합니다 - 약간의 반사 및 문자열 생성 ... –