Click here to Skip to main content
15,891,725 members
Home / Discussions / C#
   

C#

 
QuestionHow to replace the value of Img src [modified] Pin
aldo hexosa9-Feb-09 17:21
professionalaldo hexosa9-Feb-09 17:21 
AnswerRe: How to replace the value of Img src Pin
Christian Graus9-Feb-09 18:34
protectorChristian Graus9-Feb-09 18:34 
QuestionRe: How to replace the value of Img src Pin
aldo hexosa9-Feb-09 20:08
professionalaldo hexosa9-Feb-09 20:08 
QuestionMultiple Timers Pin
push19889-Feb-09 16:55
push19889-Feb-09 16:55 
AnswerRe: Multiple Timers Pin
PIEBALDconsult9-Feb-09 17:13
mvePIEBALDconsult9-Feb-09 17:13 
QuestionRe: Multiple Timers Pin
push19889-Feb-09 17:21
push19889-Feb-09 17:21 
AnswerRe: Multiple Timers Pin
PIEBALDconsult9-Feb-09 18:00
mvePIEBALDconsult9-Feb-09 18:00 
QuestionRepository pattern and LINQ [modified] Pin
minus_one9-Feb-09 16:45
minus_one9-Feb-09 16:45 
I am relatively new to design patterns and LINQ to SQL and have come across a bit of a bump, mainly due to a lack of understanding on my part.

The situation i have setup at the moment is i am using DDD and so have my Domain/Model layer with all my domain objects contained therein, and my Infrastructure layer where i am trying to implement the Respoitory pattern. In my database i have tables such as BATCH, SITE and COMPANY, with BATCH having columns such as SiteID and OwnerID which are GUID types related to the ID's columns of the SITE and COMPANY tables respectively.

I have:

public interface IRepository < t >
{
   IList < t > GetAll();
   T FindBy(object key);
   void Add(T item);
   void Remove(T item);
}

public class BatchRepository : IRepository<batch>
{
   ...
}
</batch>


What would be the best way to go about pulling a more rich set of information than just the Batch object with only GUID data?

Previously, i would of used a SQL query that used JOIN to get the Company.CompanyName using Batch.OwnerId etc...

But now, the Repository returns only the plain BATCH object from the database, and obviously then iterating through each of these Batch objects and querying the DB AGAIN for the OwnerName, SiteName etc based on the Batch.OwnerId , Batch.SiteId data is wasteful...

Should i be creating additional domain layer objects such as BatchResult that has a more rich set of data properties and making the repository return that type instead?

Thanks in advance for patience with my ignorance Wink | ;)

modified on Monday, February 9, 2009 10:51 PM

QuestionDataTable Update Access database Pin
Planker9-Feb-09 16:26
Planker9-Feb-09 16:26 
AnswerRe: DataTable Update Access database [modified] Pin
PIEBALDconsult9-Feb-09 17:03
mvePIEBALDconsult9-Feb-09 17:03 
GeneralRe: DataTable Update Access database Pin
Planker10-Feb-09 7:20
Planker10-Feb-09 7:20 
Question.net Remoting with multiple nics on client side Pin
obadran9-Feb-09 16:05
obadran9-Feb-09 16:05 
QuestionUsing a System.Windows.Forms.WebBrowser inside ASP web form Pin
trinm19879-Feb-09 14:51
trinm19879-Feb-09 14:51 
AnswerRe: Using a System.Windows.Forms.WebBrowser inside ASP web form Pin
N a v a n e e t h9-Feb-09 14:55
N a v a n e e t h9-Feb-09 14:55 
GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web form Pin
trinm19879-Feb-09 15:08
trinm19879-Feb-09 15:08 
GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web form Pin
N a v a n e e t h9-Feb-09 15:15
N a v a n e e t h9-Feb-09 15:15 
GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web form Pin
ABitSmart9-Feb-09 17:22
ABitSmart9-Feb-09 17:22 
AnswerRe: Using a System.Windows.Forms.WebBrowser inside ASP web form Pin
PIEBALDconsult9-Feb-09 17:15
mvePIEBALDconsult9-Feb-09 17:15 
QuestionReplacement for VSA Pin
User 127829-Feb-09 14:14
User 127829-Feb-09 14:14 
Questiontokenize string Pin
lawrenceinba9-Feb-09 13:54
lawrenceinba9-Feb-09 13:54 
AnswerRe: tokenize string Pin
PIEBALDconsult9-Feb-09 14:53
mvePIEBALDconsult9-Feb-09 14:53 
GeneralRe: tokenize string Pin
lawrenceinba9-Feb-09 15:19
lawrenceinba9-Feb-09 15:19 
GeneralRe: tokenize string Pin
ABitSmart9-Feb-09 16:13
ABitSmart9-Feb-09 16:13 
AnswerRe: tokenize string Pin
ABitSmart9-Feb-09 15:20
ABitSmart9-Feb-09 15:20 
GeneralRe: tokenize string Pin
lawrenceinba9-Feb-09 15:26
lawrenceinba9-Feb-09 15:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.