Imagine I have a property:
class Test
{
[Required]
public string Toot { get; set; }
}
having Required makes a migration for not allowing null in my database. I actually don't want that restriction and yet I do not want it to ever be null from now on...
Is there a way to only make it Required for front end input?
I realise I could do this:
class Test
{
[Required]
public string Toot { get; set; }
[Required]
[Display( Name = "Toot" )]
public string TootForView
{
get
{
return this.Toot ;
}
set
{
if(this.Toot != value)
{
this.Toot = value;
}
}
}
}