I have an interface called IAddress, and a class called Address that handles street, city, state/province, postal code and country. I have a couple of Linq2Sql classes that has all the address information and would like to implement the interface IAddress, and pass that in to the constructor for Address that would the load the property values.
Is it possible have a Linq2Sql class impment and interface through the partial class that I created for it? Thanks in advance!
Additional comments
In my class I have a property called MailToStreet, I want that to map to IAddress.Street. Is there a way to do this in the partial class?
Solved
Thanks StackOverflow community! It was a snap! Here is my final code:
public partial class Location : IAddress
{
string IAddress.Street
{
get { return this.Street; }
set { this.Street = value; }
}
string IAddress.City
{
get { return this.City; }
set { this.City = value; }
}
string IAddress.StateProvince
{
get { return this.StateProvince; }
set { this.StateProvince = value; }
}
string IAddress.PostalCode
{
get { return this.PostalCode; }
set { this.PostalCode = value; }
}
string IAddress.Country
{
get { return this.Country; }
set { this.Country = value; }
}
}