In my EF4 EntityModel, I have an object named USERS. USERS have common fields UserName and Password string. If I do something like this:
Dim u as new USERS
U.UserName = String.Empty
Then U.UserName is still nothing. But if I do something like this:
Dim u as new USERS
u.UserName = "A"
u.UserName = String.Empty
then U.UserName takes the value String.Empty as the value without any problems.
The reason is that EF4 generates a UserName property
Public Property UserName() As Global.System.String
Get
Return _UserName
End Get
Set
If (_UserName <> Value) Then ‘Here is the key
OnUserNameChanging(value)
ReportPropertyChanging("UserName")
_UserName = StructuralObject.SetValidValue(value, false)
ReportPropertyChanged("UserName")
OnUserNameChanged()
End If
End Set
End Property
My question is:
How can I handle this?
-, , ? , string.empty , , , , , . empty.string , "" .
#, vb.net, , - .