Click here to Skip to main content
15,907,913 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: C# code survey Pin
Marc Clifton30-Oct-18 2:53
mvaMarc Clifton30-Oct-18 2:53 
GeneralRe: C# code survey Pin
Dan Neely30-Oct-18 2:55
Dan Neely30-Oct-18 2:55 
JokeRe: C# code survey Pin
Foothill30-Oct-18 4:26
professionalFoothill30-Oct-18 4:26 
GeneralRe: C# code survey Pin
Gary Wheeler30-Oct-18 6:29
Gary Wheeler30-Oct-18 6:29 
GeneralRe: C# code survey Pin
Rob Philpott30-Oct-18 6:34
Rob Philpott30-Oct-18 6:34 
GeneralRe: C# code survey Pin
ScottM130-Oct-18 23:10
ScottM130-Oct-18 23:10 
GeneralRe: C# code survey Pin
Sander Rossel31-Oct-18 0:49
professionalSander Rossel31-Oct-18 0:49 
GeneralRe: C# code survey Pin
DerekT-P31-Oct-18 1:31
professionalDerekT-P31-Oct-18 1:31 
Could you not just use inheritance and do away with all the property setting?
public class FooDto
{
   public FooDto(T1 value1 /** 24 values later */, T24 value24)
   {
        Property1 = value1;
        // .....
        Property24 = value24;
   }

   public T1 Property1 { get; }
   // ....
   public T24 Property24 { get; }
}
// ....
class MyFooClass : FooDto
{
// ....
}

This exposes properties T1 ... T24 of the base FooDto class but that may or may not be an issue. There are arguments against combining DTOs and inheritance, so without knowing the details of your implementation this may not be appropriate. Part of "knowing the details" of course involves the use of a crystal ball to envisage future changes, but depending on the scenario you can pretty much rule out a lot of potential stuff and, in this case, save yourself a lot of code.
GeneralRe: C# code survey Pin
Super Lloyd31-Oct-18 6:38
Super Lloyd31-Oct-18 6:38 
GeneralRe: C# code survey Pin
DerekT-P31-Oct-18 8:34
professionalDerekT-P31-Oct-18 8:34 
GeneralRe: C# code survey Pin
Super Lloyd31-Oct-18 9:12
Super Lloyd31-Oct-18 9:12 
GeneralRe: C# code survey Pin
jhunley31-Oct-18 3:37
jhunley31-Oct-18 3:37 
GeneralRe: C# code survey Pin
michaelakin31-Oct-18 4:08
michaelakin31-Oct-18 4:08 
GeneralRe: C# code survey Pin
michaelakin31-Oct-18 4:08
michaelakin31-Oct-18 4:08 
GeneralRe: C# code survey Pin
jhunley31-Oct-18 4:17
jhunley31-Oct-18 4:17 
GeneralRe: C# code survey Pin
michaelakin31-Oct-18 4:29
michaelakin31-Oct-18 4:29 
GeneralRe: C# code survey Pin
jhunley31-Oct-18 5:00
jhunley31-Oct-18 5:00 
GeneralRe: C# code survey Pin
Bruce Patin31-Oct-18 3:44
Bruce Patin31-Oct-18 3:44 
GeneralRe: C# code survey Pin
michaelakin31-Oct-18 4:19
michaelakin31-Oct-18 4:19 
AnswerRe: C# code survey Pin
Leonardo Pessoa31-Oct-18 6:43
Leonardo Pessoa31-Oct-18 6:43 
GeneralRe: C# code survey Pin
Leng Vang31-Oct-18 8:06
Leng Vang31-Oct-18 8:06 
GeneralRe: C# code survey Pin
Super Lloyd31-Oct-18 9:17
Super Lloyd31-Oct-18 9:17 
GeneralRe: C# code survey Pin
Roger House31-Oct-18 14:10
Roger House31-Oct-18 14:10 
GeneralRe: C# code survey Pin
patbob1-Nov-18 5:29
patbob1-Nov-18 5:29 
GeneralI was sent this, and... Pin
OriginalGriff29-Oct-18 21:03
mveOriginalGriff29-Oct-18 21:03 

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.