Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IHasAddress {
- public string Street1 { get; set; }
- public string Street2 { get; set; }
- public string City { get; set; }
- public string State { get; set; }
- public string Zip { get; set; }
- }
- public static class Test {
- public static void CheckZip(IHasAddress addressContainer) {
- if (addressContainer == null) return;
- if (addressContainer.Zip == "33314") addressContainer.State = "FL";
- }
- }
- User user = new User();
- Business business = new Business();
- Test.CheckZip(user);
- Test.CheckZip(business);
Add Comment
Please, Sign In to add comment