Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old December 6th, 2011, 10:12 AM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default

Hi Mike,

In the context of your admin system it sounds like CustomerStatus could be its own aggregate but as it seems to be just a look up object without any behaviour you might not need to worry about aggregate roots and DDD. For your system which contains a customer you might have some complex logic and in this context customer status is a value object that is associated with a customer.

Cheers
Scott
Reply With Quote
  #12 (permalink)  
Old December 19th, 2011, 10:25 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Scott,

Thank you for your input and I have managed to solve my issue.

As a result of this I have another issue with aggregate roots and its own repository.

I have a customer aggregate root and it has its own repository but I need to query the contact table which does not have its own repository as it is an aggregate of the customer.

My table structure is below.

Customer -----> Address -----> Contact.

Is it correct to query the customer repository with an ID and then from the service layer to use a lambda expression to query the address table and then the contact table?

My issue is I do not know the lambda expression to query the contact table because I don't know the address ID.
My latest attempt is below.

Quote:
Dim cust As New Customer
cust = _customerRepository.FindBy(addRequest.ID)
cust.CustomerAddresses.Any(Function(x) x.Contacts.Where(Function(co) co.Id = 12))
The lambda expression is clearly wrong but I need to query the contact table.

Any suggestions would be great.

Thank you.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 01:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.