Click here to Skip to main content
15,916,462 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 9:58
mveRichard Deeming31-May-18 9:58 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Marc Clifton31-May-18 10:43
mvaMarc Clifton31-May-18 10:43 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
PIEBALDconsult31-May-18 10:13
mvePIEBALDconsult31-May-18 10:13 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Jon McKee31-May-18 10:17
professionalJon McKee31-May-18 10:17 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 10:19
mveRichard Deeming31-May-18 10:19 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Jon McKee31-May-18 10:22
professionalJon McKee31-May-18 10:22 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 10:42
mveRichard Deeming31-May-18 10:42 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Marc Clifton31-May-18 10:48
mvaMarc Clifton31-May-18 10:48 
Richard Deeming wrote:
But it won't work, in the sense that the returned instance will be using the default connection string for the context, not the connection string from the instance passed in.


Hmm. But the parameterless constructor uses the connection string of the (hopefully) already initialized context:

public ModelDataContext() : base(Context.Connection)

However, it's a moot point anyways as I refactored the whole mess into something much less weird.

It'll be an interesting question though to pose to a couple of the devs at work, though I'll reduce the complexity of it omitting the DataContext base class - it's rather superfluous to the example.
Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 11:01
mveRichard Deeming31-May-18 11:01 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Marc Clifton1-Jun-18 1:54
mvaMarc Clifton1-Jun-18 1:54 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
soulesurfer3-Jun-18 21:34
soulesurfer3-Jun-18 21:34 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
englebart4-Jun-18 2:57
professionalenglebart4-Jun-18 2:57 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
jfren4844-Jun-18 8:10
jfren4844-Jun-18 8:10 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Q The First Timelord4-Jun-18 8:27
Q The First Timelord4-Jun-18 8:27 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
AnotherKen7-Jun-18 20:57
professionalAnotherKen7-Jun-18 20:57 
GeneralMmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 6:10
mveOriginalGriff31-May-18 6:10 
PraiseRe: Mmmm - it' s nice to know that they care about me... Pin
lopatir31-May-18 6:27
lopatir31-May-18 6:27 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 7:54
professionalEddy Vluggen31-May-18 7:54 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 8:00
mveOriginalGriff31-May-18 8:00 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 8:16
professionalEddy Vluggen31-May-18 8:16 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 8:22
mveOriginalGriff31-May-18 8:22 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 8:38
professionalEddy Vluggen31-May-18 8:38 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Daniel Pfeffer31-May-18 9:30
professionalDaniel Pfeffer31-May-18 9:30 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 9:51
mveOriginalGriff31-May-18 9:51 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Michael Martin31-May-18 11:20
professionalMichael Martin31-May-18 11:20 

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.