Click here to Skip to main content
15,896,376 members
Articles / Programming Languages / C#

Validation Across Class Hierarchies and Interface Implementations

Rate me:
Please Sign up or sign in to vote.
4.00/5 (4 votes)
12 May 2008LGPL33 min read 29K   100   25  
Dependency injection of validation rules and their application across class hierarchies and interface implementations
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleTest {
    public class Person {

        private string firstName;

        private string lastName;

        private int age;

        /*private string country;

        private string city;*/

        public virtual string FirstName {
            get {
                return firstName;
            }
            set {
                firstName = value;
            }
        }

        public virtual string LastName {
            get {
                return lastName;
            }
            set {
                lastName = value;
            }
        }

        public virtual int Age {
            get {
                return age;
            }
            set {
                age = value;
            }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Technical Lead Olivine Technology
Kenya Kenya
Technical Lead, Olivine Technology - Nairobi, Kenya.

"The bane of productivity: confusing the rituals of work (sitting at your desk by 8:00am, wearing a clean and well pressed business costume etc.) with actual work that produces results."

Watch me!

Comments and Discussions