This question is locked. New answers and comments are not allowed.
Hello. I'm trying to evaluate OpenAccess ORM. I created internal interface with dataannotations and partial Bank class:
But i cannot get error. What i'm doing wrong?
internal
interface
IBank
{
[Required(ErrorMessageResourceName =
"BankNameMandatory"
, ErrorMessageResourceType =
typeof
(Resources))]
[StringLength(50, ErrorMessageResourceName =
"BankNameMaxLength"
,
ErrorMessageResourceType =
typeof
(Resources))]
string
Name {
get
;
set
; }
[Required(ErrorMessageResourceName =
"BankCodeMandatory"
, ErrorMessageResourceType =
typeof
(Resources))]
[StringLength(15, ErrorMessageResourceName =
"BankCodeMaxLength"
,
ErrorMessageResourceType =
typeof
(Resources))]
string
Code {
get
;
set
; }
[StringLength(50, ErrorMessageResourceName =
"BankAddressMaxLength"
,
ErrorMessageResourceType =
typeof
(Resources))]
string
Address {
get
;
set
; }
[StringLength(9, ErrorMessageResourceName =
"BankExtraCodeMaxLength"
,
ErrorMessageResourceType =
typeof
(Resources))]
string
ExtraCode {
get
;
set
; }
}
[MetadataType(
typeof
(IBank))]
public
partial
class
Bank : IDataErrorInfo, IBank
{
[NonSerialized]
private
readonly
DataErrorInfoSupport _dataErrorInfoSupport;
public
Bank()
{
_dataErrorInfoSupport =
new
DataErrorInfoSupport(
this
);
}
#region IDataErrorInfo Members
public
string
Error
{
get
{
return
_dataErrorInfoSupport.Error; }
}
string
IDataErrorInfo.
this
[
string
memberName]
{
get
{
return
_dataErrorInfoSupport[memberName]; }
}
#endregion
}
But i cannot get error. What i'm doing wrong?