public string this[string columnName] { get { if (validator == null) { validator = new NetPortInfoModelValidator(); } var firstOrDefault = validator.Validate(this) .Errors.FirstOrDefault(lol => lol.PropertyName == columnName); return(firstOrDefault?.ErrorMessage); } }
public NetPortInfoModel() { validator = new NetPortInfoModelValidator(); }