Click here to Skip to main content
15,867,488 members
Home / Discussions / C#
   

C#

 
GeneralRe: BAL,DAL Pin
Member 136064294-Jan-18 19:20
Member 136064294-Jan-18 19:20 
QuestionEntity Framework Query Problem Pin
Kevin Marois3-Jan-18 18:38
professionalKevin Marois3-Jan-18 18:38 
AnswerRe: Entity Framework Query Problem Pin
Vincent Maverick Durano3-Jan-18 19:59
professionalVincent Maverick Durano3-Jan-18 19:59 
QuestionBlink an image in wpf c# Pin
Hervend2-Jan-18 23:01
Hervend2-Jan-18 23:01 
AnswerRe: Blink an image in wpf c# Pin
Pete O'Hanlon2-Jan-18 23:07
subeditorPete O'Hanlon2-Jan-18 23:07 
AnswerRe: Blink an image in wpf c# Pin
Eddy Vluggen3-Jan-18 2:37
professionalEddy Vluggen3-Jan-18 2:37 
AnswerRe: Blink an image in wpf c# Pin
Gerry Schmitz3-Jan-18 5:35
mveGerry Schmitz3-Jan-18 5:35 
QuestionIs it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 22:15
professionalUser987432-Jan-18 22:15 
If I have an object defined in a method and pass that object into another method, perform some operation that changes a parameter value in that object and then pass the same object back to the caller, is that the same as using ref or out?

Inside some method:

SomeObj myobj = new SomeObj ( someparam = "Some Value" );
myobj = DoSomething( myobj );


And then the method:

private SomeObj DoSomething( SomeObj myobj )
{
   myobj.someparam = "Some New Value";
   return myobj;
}


I'm trying to wrap my head around this in C#. I'm not sure if there are any pitfalls to doing it this way.
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Pete O'Hanlon2-Jan-18 22:20
subeditorPete O'Hanlon2-Jan-18 22:20 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 23:06
professionalUser987432-Jan-18 23:06 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
OriginalGriff2-Jan-18 22:45
mveOriginalGriff2-Jan-18 22:45 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 23:06
professionalUser987432-Jan-18 23:06 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton6-Jan-18 4:19
mvaMarc Clifton6-Jan-18 4:19 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff4-Jan-18 23:07
professionalBillWoodruff4-Jan-18 23:07 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987435-Jan-18 13:18
professionalUser987435-Jan-18 13:18 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff5-Jan-18 21:13
professionalBillWoodruff5-Jan-18 21:13 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton6-Jan-18 4:14
mvaMarc Clifton6-Jan-18 4:14 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff6-Jan-18 7:40
professionalBillWoodruff6-Jan-18 7:40 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton8-Jan-18 3:03
mvaMarc Clifton8-Jan-18 3:03 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff8-Jan-18 5:18
professionalBillWoodruff8-Jan-18 5:18 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User9874315-Jan-18 4:10
professionalUser9874315-Jan-18 4:10 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton6-Jan-18 3:56
mvaMarc Clifton6-Jan-18 3:56 
QuestionC# Progammer Forum for Beginners? Pin
User987432-Jan-18 21:27
professionalUser987432-Jan-18 21:27 
AnswerRe: C# Progammer Forum for Beginners? Pin
Ralf Meier2-Jan-18 21:55
professionalRalf Meier2-Jan-18 21:55 
AnswerRe: C# Progammer Forum for Beginners? Pin
OriginalGriff2-Jan-18 22:09
mveOriginalGriff2-Jan-18 22:09 

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.