Click here to Skip to main content
15,886,963 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Code special to MVC Pin
Richard Deeming28-Jun-16 3:10
mveRichard Deeming28-Jun-16 3:10 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 3:40
mveDave Kreskowiak28-Jun-16 3:40 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 3:44
larsp77728-Jun-16 3:44 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 3:50
mveDave Kreskowiak28-Jun-16 3:50 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 4:00
larsp77728-Jun-16 4:00 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 3:48
larsp77728-Jun-16 3:48 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 4:39
mveDave Kreskowiak28-Jun-16 4:39 
AnswerRe: Code special to MVC Pin
Richard Deeming28-Jun-16 3:12
mveRichard Deeming28-Jun-16 3:12 
Further to Dave's answer, see:
Object and Collection Initializers (C# Programming Guide)[^]
How to: Initialize Objects by Using an Object Initializer (C# Programming Guide)[^]

Since you're not passing any constructor parameters, you don't even need the empty parentheses after the type name:
C#
var movie = new Movie {
    Name = "Shrek!"
};




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 3:50
larsp77728-Jun-16 3:50 
GeneralRe: Code special to MVC Pin
Richard Deeming28-Jun-16 3:56
mveRichard Deeming28-Jun-16 3:56 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 4:01
larsp77728-Jun-16 4:01 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 4:29
larsp77728-Jun-16 4:29 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 4:41
mveDave Kreskowiak28-Jun-16 4:41 
GeneralRe: Code special to MVC Pin
Pete O'Hanlon28-Jun-16 4:50
mvePete O'Hanlon28-Jun-16 4:50 
AnswerRe: Code special to MVC Pin
Member 126169193-Jul-16 19:49
Member 126169193-Jul-16 19:49 
QuestionAsp.net mvc5,html5 Pin
Member 1236843723-Jun-16 21:30
Member 1236843723-Jun-16 21:30 
SuggestionRe: Asp.net mvc5,html5 Pin
CHill6024-Jun-16 0:27
mveCHill6024-Jun-16 0:27 
AnswerRe: Asp.net mvc5,html5 Pin
Dave Kreskowiak24-Jun-16 3:59
mveDave Kreskowiak24-Jun-16 3:59 
AnswerRe: Asp.net mvc5,html5 Pin
Gerry Schmitz24-Jun-16 4:10
mveGerry Schmitz24-Jun-16 4:10 
AnswerRe: Asp.net mvc5,html5 Pin
Nathan Minier28-Jun-16 1:24
professionalNathan Minier28-Jun-16 1:24 
QuestionGeneric Function for executing any parametric/non parametric function using C# Pin
Anuj Srivastava - 116-Jun-16 0:48
Anuj Srivastava - 116-Jun-16 0:48 
AnswerRe: Generic Function for executing any parametric/non parametric function using C# Pin
Pete O'Hanlon6-Jun-16 0:58
mvePete O'Hanlon6-Jun-16 0:58 
GeneralRe: Generic Function for executing any parametric/non parametric function using C# Pin
Anuj Srivastava - 116-Jun-16 1:14
Anuj Srivastava - 116-Jun-16 1:14 
GeneralRe: Generic Function for executing any parametric/non parametric function using C# Pin
Pete O'Hanlon6-Jun-16 2:00
mvePete O'Hanlon6-Jun-16 2:00 
QuestionHow to clear Parser error in MVC 4? Pin
divyashasha1-Jun-16 8:31
divyashasha1-Jun-16 8:31 

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.