So in my mvc project's Project.Repository I have
[MetadataType(typeof(FalalaMetadata))]
public partial class Falala
{
public string Name { get; set; }
public string Age { get; set; }
internal sealed class FalalaMetadata
{
[Required(ErrorMessage="Falala requires name.")]
public string Name { get; set; }
[Required(ErrorMessage = "Falala requires age.")]
public string Age { get; set; }
}
}
I use Falala as a model in my Project.Web.AccountControllers, and use a method to get violations. Validating worked when I had
public class Falala
{
[Required]
public string Name { get; set; }
[Required(ErrorMessage="error")]
public string Age { get; set; }
}
but not after using the partial class from above. I really need to use a partial class. What am I doing wrong here?
Thanks!