Duplicate Validators when ValidationSpecificationSource.All

Topics: Validation Application Block
Jan 24, 2011 at 10:44 PM

I have a class:

public class Lookup
{
      public int Id { get; set; }
      public string Name { get; set; }
}

and app.config has one rule (NotNullValidator) to be applied to Name.

I downloaded the latest source code of Validator Block and I put a trace (Console.WriteLine(GetType().Name)) in the Validator class, and here my surprise:

  1. weird: when Validation.Validate<Lookup>(new Lookup(), ValidationSpecificationSource.All); is called, two instances of "NotNullValidator" is created
  2. expected: when Validation.Validate<Lookup>(new Lookup(), ValidationSpecificationSource.Configuration); is called only one instance of "NotNullValidator" is created.

Why case #1 is happening?

Jan 25, 2011 at 12:24 PM

Haven't had a chance to look into this yet. We'll look into this and keep you updated what we may find.

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 26, 2011 at 2:47 AM
Edited Jan 26, 2011 at 2:49 AM

Could you tell me where exactly did it create the two instances of NotNullValidator?  I debugged through the entlib source code but couldn't find where exactly are you referring to.

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 26, 2011 at 2:19 PM

I sent an email with my testing VS2010 project where I modified the constructor implementation for Validator class adding a Console.WriteLine(GetType().Name) trace.

Jan 26, 2011 at 2:58 PM

Your email server rejected the email saying that attachment was too big.

Is there another way for me to send you the project?

Jan 27, 2011 at 3:45 AM

How large is the file you're sending? I've just tried sending 5megs in our mailbox and got it successfully. If it's too large you can send it in multiple emails :)

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 27, 2011 at 2:04 PM


On Wed, Jan 26, 2011 at 10:45 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

How large is the file you're sending? I've just tried sending 5megs in our mailbox and got it successfully. If it's too large you can send it in multiple emails :)

Gino Terrado


Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Michel Fornaris
Senior Software Engineer
Voice: 305-878-8717

Failing to Plan is Planning to Fail

Jan 27, 2011 at 2:13 PM


On Wed, Jan 26, 2011 at 10:45 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

How large is the file you're sending? I've just tried sending 5megs in our mailbox and got it successfully. If it's too large you can send it in multiple emails :)

Gino Terrado


Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Michel Fornaris
Senior Software Engineer
Voice: 305-878-8717

Failing to Plan is Planning to Fail

Jan 31, 2011 at 1:17 AM

Yes, how large is the size of the file?  Did you remove the bin and obj folders?  If the size can't be helped, try uploading it to windows live skydrive.

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com