In the Enterprise Library, how does the abstract Validator.cs have a method definition?

Posted by Soham on Stack Overflow See other posts from Stack Overflow or by Soham
Published on 2010-04-24T03:28:37Z Indexed on 2010/04/24 6:23 UTC
Read the original article Hit count: 138

Filed under:
|

Consider this piece of code:

public abstract class Validator
{

    protected Validator()
    {
    }


    protected abstract void ValidateCore(object instance, string value, IList<ValidationResult> results);


    public void Validate(object instance, string value, IList<ValidationResult> results)
    {
        if (null == instance) throw new ArgumentNullException("instance");
        if (null == results) throw new ArgumentNullException("results");

        ValidateCore(instance, value, results);
    }
}

Look at the Validate() overload, how can an abstract class have definitions like this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about enterprise-library