我有兩個類用作兩個不同視圖的模型。你可以看到第二個類包含第一個類的實例。第一個包含遠程驗證屬性。 [MetadataType(typeof(ExceptionLogModel.EmailRecipientMetadata))]
public class EmailRecipientViewModel
{
public int EmailRecipientID { get; set;
想象這樣的情況: 的SetUp 在默認的MVC3項目,在AccountModels.cs public class GlobalAccount
{
public GlobalAccount()
{
this.LogOn = new LogOnModel();
this.Register = new RegisterModel();
}
我有一個角色模型 public class Person
{
public int ID { get; set; }
[Required]
[Remote("UserNameExists", "People", "Username is already taken.")]
public string Name { get; set; }
我意識到這個問題已經被詢問了很多次。然而,沒有任何解決方案爲我工作。 問題: 我有一個對象: public class SomeObject
{
[Remote("MyAction", "MyController")]
public DateTime MyDate { get; set; }
}
和模型: public class SomeModel
{
p