Click here to Skip to main content
15,890,609 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
gshen2-Mar-12 6:07
gshen2-Mar-12 6:07 
AnswerRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
Bernhard Hiller1-Mar-12 20:38
Bernhard Hiller1-Mar-12 20:38 
GeneralRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
gshen2-Mar-12 6:09
gshen2-Mar-12 6:09 
AnswerRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
BobJanova1-Mar-12 23:28
BobJanova1-Mar-12 23:28 
GeneralRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
gshen2-Mar-12 6:11
gshen2-Mar-12 6:11 
AnswerRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
#realJSOP2-Mar-12 4:21
mve#realJSOP2-Mar-12 4:21 
GeneralRe: How to know application exit in Console started by Process.Start("cmd.exe")) Pin
gshen2-Mar-12 6:15
gshen2-Mar-12 6:15 
QuestionIQueryable or IEnumerable as returns from Repositories Pin
Ciumac Sergiu1-Mar-12 10:57
Ciumac Sergiu1-Mar-12 10:57 
Hi all,
Repository[^] pattern with Unit of Work[^] and Dependency Injection, seem to be a universaly accepted solution for ASP.NET + EF applications. There are still some minor questions that I would like to ask here.
Consider the following method from a generic IRepository interface:
C#
public IQueryable<T> Get<T>() where T : class
{
    return Set<T>();
}


I wonder, is it a good practice in reveling IQueryable interface to the callers. This means that the calling method can add filters/paggin/sorting, but at the same time the repository itself becomes not unit testable (you cant rely anymore on what the repository will actually return). The caller can even add a non-translatable predicate that will break at runtime. So, is it a good practice in hiding IQueryable interface from the caller, and defining IEnumerable interface instead?

Also, I wonder how do you perform integration tests on repositories? Do you use SQL CE4, full SQL Server, or just Fake objects on DbContext?

Appreciate your response,
With regards

modified 1-Mar-12 17:45pm.

GeneralRe: IQueryable or IEnumerable as returns from Repositories Pin
PIEBALDconsult1-Mar-12 11:42
mvePIEBALDconsult1-Mar-12 11:42 
QuestionIs it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 4:15
Icarii1-Mar-12 4:15 
AnswerRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Dave Kreskowiak1-Mar-12 9:00
mveDave Kreskowiak1-Mar-12 9:00 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 9:49
Icarii1-Mar-12 9:49 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
#realJSOP1-Mar-12 10:08
mve#realJSOP1-Mar-12 10:08 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 9:50
Icarii1-Mar-12 9:50 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Dave Kreskowiak1-Mar-12 12:59
mveDave Kreskowiak1-Mar-12 12:59 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 16:50
Icarii1-Mar-12 16:50 
QuestionExchange Server 2007 - Commands Pin
Sebastian T Xavier29-Feb-12 22:53
Sebastian T Xavier29-Feb-12 22:53 
AnswerRe: Exchange Server 2007 - Commands Pin
Dave Kreskowiak1-Mar-12 3:37
mveDave Kreskowiak1-Mar-12 3:37 
QuestionQuick Constructor Question Pin
Kevin Marois29-Feb-12 12:01
professionalKevin Marois29-Feb-12 12:01 
AnswerRe: Quick Constructor Question Pin
RobCroll29-Feb-12 13:36
RobCroll29-Feb-12 13:36 
GeneralRe: Quick Constructor Question Pin
J4amieC1-Mar-12 5:22
J4amieC1-Mar-12 5:22 
AnswerRe: Quick Constructor Question Pin
GParkings29-Feb-12 22:47
GParkings29-Feb-12 22:47 
AnswerRe: Quick Constructor Question Pin
BobJanova1-Mar-12 5:27
BobJanova1-Mar-12 5:27 
QuestionPassing values between classes Pin
CCodeNewbie29-Feb-12 10:33
CCodeNewbie29-Feb-12 10:33 
AnswerRe: Passing values between classes Pin
Wes Aday29-Feb-12 10:54
professionalWes Aday29-Feb-12 10:54 

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.