ASP.NET MVC2 - using LINQ-generated class
- by ile
There are few things not clear to me about ASP.NET MV2.
In database I have table Contacts with several fields, and there is an additional field XmlFields of which type is xml. In that field are stored additional description fields.
There are 4 classes:
Contact class which corresponds to Contact table and is defined by default when creating LINQ classes
ContactListView class which inherits
Contact class and has some
additional properties
ContactXmlView class that contains
fields from XmlFields field
ContactDetailsView class which
merges ContactListView and
ContactXmlView into one class and
this one is used to display data in
view pages
ContactListView class has re-defined some properties from Contact class (so that I can add [Required] filter used for validation) - but I get warning message:
'ObjectTest.Models.Contacts.ContactListView.FirstName'
hides inherited member
'SA.Model.Contact.FirstName'. Use the
new keyword if hiding was intended.
ContactDetailsView class is also used in a form when creating new contact and adding it to database.
I am not sure if this is correct way, and the warning message confuses me a bit. Any advise about this?
Thanks,
Ile