Hi Team,
I have class library in .net Standard 2.0 with EntityFrameworkCore. I have created class with Custom Data Annotation as below:
Model Definition
public class UserLogin : NotificationObject
{
[DbRequired]
[Display(Name = "USER NAME", Prompt = "ENTER USER NAME")]
public string User_Name
{
get { return GetValue(() => User_Name); }
set { SetValue(() => User_Name, value); }
}
[Display(Name = "PASSWORD", Prompt = "ENTER PASSWORD")]
[DataType(DataType.Password)]
[DbRequired]
public string User_Password
{
get { return GetValue(() => User_Password); }
set { SetValue(() => User_Password, value); }
}
}
**But this data annotation validation is working in Asp.Net Core and WPF. But we want to use the same in Xamarin.Forms for Android & iOS and UWP. Is it possible or any workaround? As I heard that in .net Standard you need write once and can be reuse in all other environment **