aspnet / AspNetWebStack

ASP.NET MVC 5.x, Web API 2.x, and Web Pages 3.x (not ASP.NET Core)
Other
858 stars 354 forks source link

Adding a new RemoteAttribute seems to cause other EF6 attributes to be ignored #253

Closed Tiberriver256 closed 3 years ago

Tiberriver256 commented 5 years ago

This will have an index created:

public class MyClass {
   [Index(IsUnique = true)]
   public string MyProperty {get; set;}
}

No index will be created:

public class MyClass {
   [Index(IsUnique = true)]
   [Remote("MyValidationMethod", "MyController", ErrorMessage = "MyErrorMessage")]
   public string MyProperty {get; set;}
}

Using v5.2.7 of Microsoft.AspNet.Mvc and EF v6.2.0

Tiberriver256 commented 5 years ago

My workaround for now was to use the DbModelBuilder and the fluent api to put in the typical annotations.

mkArtakMSFT commented 3 years ago

Thanks for contacting us. Glad that you have a workaround available.

We're not making any improvements in this area any more as this project is in maintenance mode. Only critical blocking issue with wide impact and security issues are considered.