I implemented a basic domain object where the properties have Validator
attributes see below for example:
using System;
using System.Collections.Generic;
using System.Text;

using Castle.Components.Validator;

namespace FIT2.Models
{
    /// <summary>
    /// Class for Providing Feedback on Site, utilizes Castle.Validator
Attributes
    /// </summary>
    public class FeedBack
    {

        private string bodyContent;
        private string fromEmailAddress;
        private string subject;

        [ValidateNonEmpty]
        public string Subject
        {
            get { return subject; }
            set { subject = value; }
        }

        [ValidateNonEmpty("Content is Empty")]
        public string BodyContent
        {
            get { return bodyContent; }
            set { bodyContent = value; }
        }

        [ValidateEmail("Email does not look right")]
        public string FromEmailAddress
        {
            get { return fromEmailAddress; }
            set { fromEmailAddress = value; }
        }



    }
}

On Fri, Feb 20, 2009 at 9:37 AM, Flominator <[email protected]> wrote:

>
> Hi all,
>
> the page http://www.castleproject.org/components/validator/index.html
> mentions "attribute driven syntax", but I can't find any attributes in
> the sample domain object. May there be something missing on this page?
>
> Regards,
>
> Flo
> >
>


-- 
David J. Driscoll

www.EnduroTracker.com
EnduroTracker.BlogSpot.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to