Click here to Skip to main content
15,922,015 members
Home / Discussions / C#
   

C#

 
GeneralIssues in creating SQL Server Database with C# windows Application Pin
Mohan Subramani4-Feb-14 3:15
Mohan Subramani4-Feb-14 3:15 
GeneralRe: Issues in creating SQL Server Database with C# windows Application Pin
Ravi Bhavnani4-Feb-14 6:24
professionalRavi Bhavnani4-Feb-14 6:24 
AnswerRe: Creating a small project using C# - Please Help Pin
John D. Sanders4-Feb-14 9:13
John D. Sanders4-Feb-14 9:13 
QuestionArtificial Neural Network Pin
Member 95388301-Feb-14 23:34
Member 95388301-Feb-14 23:34 
AnswerRe: Artificial Neural Network Pin
Kornfeld Eliyahu Peter2-Feb-14 0:06
professionalKornfeld Eliyahu Peter2-Feb-14 0:06 
GeneralRe: Artificial Neural Network Pin
Member 95388302-Feb-14 0:50
Member 95388302-Feb-14 0:50 
QuestionDiamond Program with few requirements Pin
balaramanN1-Feb-14 19:47
balaramanN1-Feb-14 19:47 
AnswerRe: Diamond Program with few requirements Pin
Mycroft Holmes1-Feb-14 20:20
professionalMycroft Holmes1-Feb-14 20:20 
AnswerRe: Diamond Program with few requirements Pin
Richard MacCutchan1-Feb-14 21:32
mveRichard MacCutchan1-Feb-14 21:32 
Questionproblem in crystal report Pin
Shuaib wasif khan1-Feb-14 10:31
Shuaib wasif khan1-Feb-14 10:31 
AnswerRe: problem in crystal report Pin
Mycroft Holmes1-Feb-14 20:19
professionalMycroft Holmes1-Feb-14 20:19 
AnswerRe: problem in crystal report Pin
John D. Sanders4-Feb-14 9:15
John D. Sanders4-Feb-14 9:15 
QuestionBest practise for using EF Entities Pin
Shady George1-Feb-14 10:13
Shady George1-Feb-14 10:13 
AnswerRe: Best practise for using EF Entities Pin
Dave Kreskowiak1-Feb-14 13:07
mveDave Kreskowiak1-Feb-14 13:07 
GeneralMessage Closed Pin
2-Feb-14 9:51
cseder2-Feb-14 9:51 
GeneralRe: Best practise for using EF Entities Pin
Dave Kreskowiak2-Feb-14 11:46
mveDave Kreskowiak2-Feb-14 11:46 
RantRe: Best practise for using EF Entities Pin
cseder2-Feb-14 15:19
cseder2-Feb-14 15:19 
GeneralRe: Best practise for using EF Entities Pin
Shady George2-Feb-14 15:50
Shady George2-Feb-14 15:50 
Thanks for the reasoned and well thought out answer Dave. In showing you only a tiny patch of my code, I actually missed out the whole structure that this little method sits in.

This method, as with all my other calls to EF sits in a service class written to handle all the calls to a particular table. for example, all the calls to the purchase table are made from the clsPurchaseHandler class, thus separating it from the UI.

Your answer is exactly what I wanted. as I explained I am a freelance programmer running my own little operation, and I haven't got the luxury of being able to discuss code with anyone, and there's always the niggle at the back of my mind that 'I know it works, but is it the most efficient'. Your code detailing the disposal of entities after use and the find method is invaluable.

As for my naming of the method "ReturnPurchaseItem", that's my usual practise, as that's what the method does, I take your point that it may sound vague, but I've got a lot of code out in the wild that uses this notation, so for now, I'll stick with it.


Thanks again Dave, much appreciated.

George
George

GeneralRe: Best practise for using EF Entities Pin
Shady George2-Feb-14 17:05
Shady George2-Feb-14 17:05 
GeneralRe: Best practise for using EF Entities Pin
Dave Kreskowiak2-Feb-14 18:52
mveDave Kreskowiak2-Feb-14 18:52 
GeneralRe: Best practise for using EF Entities Pin
Shady George4-Feb-14 8:28
Shady George4-Feb-14 8:28 
GeneralRe: Best practise for using EF Entities Pin
Dave Kreskowiak4-Feb-14 10:11
mveDave Kreskowiak4-Feb-14 10:11 
GeneralRe: Best practise for using EF Entities Pin
Shady George4-Feb-14 10:18
Shady George4-Feb-14 10:18 
GeneralRe: Best practise for using EF Entities Pin
Shady George5-Feb-14 10:07
Shady George5-Feb-14 10:07 
GeneralRe: Best practise for using EF Entities Pin
Dave Kreskowiak5-Feb-14 10:49
mveDave Kreskowiak5-Feb-14 10:49 

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.