Click here to Skip to main content
15,167,925 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows 7 Files Explorer - New Folder In Tree Pin
Eddy Vluggen9-Sep-12 1:29
professionalEddy Vluggen9-Sep-12 1:29 
GeneralRe: Windows 7 Files Explorer - New Folder In Tree Pin
fakir4459-Sep-12 6:14
Memberfakir4459-Sep-12 6:14 
GeneralRe: Windows 7 Files Explorer - New Folder In Tree Pin
Eddy Vluggen9-Sep-12 6:35
professionalEddy Vluggen9-Sep-12 6:35 
GeneralRe: Windows 7 Files Explorer - New Folder In Tree Pin
fakir4459-Sep-12 10:24
Memberfakir4459-Sep-12 10:24 
QuestionIs it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
Mohammad Dayyan8-Sep-12 22:52
MemberMohammad Dayyan8-Sep-12 22:52 
QuestionRe: Is it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
Eddy Vluggen9-Sep-12 1:26
professionalEddy Vluggen9-Sep-12 1:26 
AnswerRe: Is it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
Mohammad Dayyan9-Sep-12 1:52
MemberMohammad Dayyan9-Sep-12 1:52 
AnswerRe: Is it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
Eddy Vluggen9-Sep-12 2:12
professionalEddy Vluggen9-Sep-12 2:12 
Mohammad Dayyan wrote:
there are some reasons that you could find them with Google.

The answer to the question can probably also be found with a lot of Googeling. Like I said, I have no experience with the EF, just thought I'd try to formulate half an answer and see how far we could get, since the rest of the members seem to be stuck in the lounge.

Easiest strategy to verify the idea is to have you convince me that your approach is the correct one; since you already have the arguments, that'd probably be easy. If one can explain the motivation behind a solution, they'll at least have considered and weighed all (known) options. No, that's not a guarantee that it's the most optimal solution, but it is an indication that it is a the most ideal at the time of implementation.

Mohammad Dayyan wrote:
With Repository pattern we could hide DbContext(or ObjectContext) in UI layer for UI programmers and the they don't need to work with DbContext directly.

That implies that they will bother you whenever there's a need for a change in the intermediate class. At a previous location, someone had the same bright idea on a SqlConnection, killing the possibility of hooking up a SqlTransaction. If one learns to program, one should know what a IDbConnection is, and how to use it - hiding it had no extra value for us, only downsides. Convince yourself that such is not the case for your DbContext.

Mohammad Dayyan wrote:
otherwise, for each entity we have to write Update, Delete, Insert, ... methods. So with repository "Don't Repeat Yourself"

Really? Looks like I won't be using EF for a while then, I don't like to do repetitive tasks that can be automated. Mostly because I'm known to make mistakes, and the computer does not. Doesn't the EF create "entities" to work on that translate into those kind of queries automatic? If not, you got a good point here, would be in violation of the DRY-principle.

Mohammad Dayyan wrote:
Static class is an instance for all, and it has the same position in RAM of system.

but Singleton has a static field and we can have different instances of our class, but we prevent coupling

Why, you planning on using other databases? A static class would suffice IMO; even if you DO use another database, you'd be changing the connectionstring, not the class.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

AnswerRe: Is it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
jschell9-Sep-12 5:24
Memberjschell9-Sep-12 5:24 
GeneralRe: Is it OK to implement Repository Pattern with Singleton in C# and EntityFramework ? Pin
Mohammad Dayyan27-Sep-12 3:26
MemberMohammad Dayyan27-Sep-12 3:26 
QuestionC# scheduled jobs Pin
dcof8-Sep-12 17:46
Memberdcof8-Sep-12 17:46 
AnswerRe: C# scheduled jobs Pin
PIEBALDconsult8-Sep-12 20:08
professionalPIEBALDconsult8-Sep-12 20:08 
AnswerRe: C# scheduled jobs Pin
jschell9-Sep-12 5:27
Memberjschell9-Sep-12 5:27 
QuestionC# directory folder levels Pin
dcof8-Sep-12 17:45
Memberdcof8-Sep-12 17:45 
AnswerRe: C# directory folder levels Pin
Eddy Vluggen9-Sep-12 1:23
professionalEddy Vluggen9-Sep-12 1:23 
AnswerRe: C# directory folder levels Pin
jschell9-Sep-12 5:30
Memberjschell9-Sep-12 5:30 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 9:49
Memberdcof9-Sep-12 9:49 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 11:05
mvaPete O'Hanlon9-Sep-12 11:05 
GeneralRe: C# directory folder levels Pin
dcof9-Sep-12 11:30
Memberdcof9-Sep-12 11:30 
GeneralRe: C# directory folder levels Pin
Pete O'Hanlon9-Sep-12 11:35
mvaPete O'Hanlon9-Sep-12 11:35 
AnswerRe: C# directory folder levels Pin
jschell10-Sep-12 9:55
Memberjschell10-Sep-12 9:55 
QuestionC# linq not update table correctly Pin
classy_dog8-Sep-12 16:19
Memberclassy_dog8-Sep-12 16:19 
QuestionC# with several proejct folders using linq to sql Pin
classy_dog8-Sep-12 16:14
Memberclassy_dog8-Sep-12 16:14 
AnswerRe: C# with several proejct folders using linq to sql Pin
Dave Kreskowiak8-Sep-12 17:58
mveDave Kreskowiak8-Sep-12 17:58 
GeneralRe: C# with several proejct folders using linq to sql Pin
classy_dog9-Sep-12 9:51
Memberclassy_dog9-Sep-12 9:51 

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.