Interface name in front of method name meaning in c#? [closed]How do I calculate someone's age in C#?What is the difference between String and string in C#?What does the [Flags] Enum Attribute mean in C#?Hidden Features of C#?Cast int to enum in C#How do I enumerate an enum in C#?What are the correct version numbers for C#?What do two question marks together mean in C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Proper use of the IDisposable interface
Questions about Noun+が+Adjective
Understanding data transmission rates over copper wire
Turn off Google Chrome's Notification for "Flash Player will no longer be supported after December 2020."
What is the definition of belonging in axiomatic set theory?
Four day weekend?
How to save money by shopping at a variety of grocery stores?
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
Existing light fixture is connected to 2 white wires, black wires are capped
Where should I draw the line on follow up questions from previous employer
Using font to highlight a god's speech in dialogue
Heavy Box Stacking
Sum and average calculator
Can the inductive kick be discharged without a freewheeling diode, in this example?
Moving DNS hosting for Active site to Route 53 - with G Suite MX TTL of 1 week
How were US credit cards verified in-store in the 1980's?
Does the telecom provider need physical access to the SIM card to clone it?
Don't look at what I did there
Is it good practice to speed up and slow down where not written in a song?
In Toy Story, are toys the only inanimate objects that become alive? And if so, why?
Can UV radiation be safe for the skin?
Ideas behind the 8.Bd3 line in the 4.Ng5 Two Knights Defense
LINQ Extension methods MinBy and MaxBy
Properly unlinking hard links
How to load files as a quickfix window at start-up
Interface name in front of method name meaning in c#? [closed]
How do I calculate someone's age in C#?What is the difference between String and string in C#?What does the [Flags] Enum Attribute mean in C#?Hidden Features of C#?Cast int to enum in C#How do I enumerate an enum in C#?What are the correct version numbers for C#?What do two question marks together mean in C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Proper use of the IDisposable interface
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I began to learn c# and specifically asp.net core and I came across a piece of code which I just can't understand what it means. I was reading docs to find some similar examples, but couldn't find anything.
public class Startup
{
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration get;
Why inside class
Startup
there is another keywordStartup
? if that's a method, then why it starts with capital?Why there is
IConfiguration
interface in front ofConfiguration
? Shouldn't it be after, like:IConfiguration
? And why is there empty body definition if it's not abstract function? Thanks.
c# asp.net-core
closed as too broad by mjwills, John, SO used to be good, BACON, gnat Mar 28 at 9:34
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
So I began to learn c# and specifically asp.net core and I came across a piece of code which I just can't understand what it means. I was reading docs to find some similar examples, but couldn't find anything.
public class Startup
{
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration get;
Why inside class
Startup
there is another keywordStartup
? if that's a method, then why it starts with capital?Why there is
IConfiguration
interface in front ofConfiguration
? Shouldn't it be after, like:IConfiguration
? And why is there empty body definition if it's not abstract function? Thanks.
c# asp.net-core
closed as too broad by mjwills, John, SO used to be good, BACON, gnat Mar 28 at 9:34
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Thispublic Startup(IConfiguration configuration)
is the constructor of the classStartup
and receives an object that implements the interfaceIConfiguration
. Thispublic IConfiguration Configuration get;
is a property with a getter so client code can access theIConfiguration
object.
– dcg
Mar 28 at 0:17
4
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
See some c# tutorials
– Alexander
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
1
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51
add a comment |
So I began to learn c# and specifically asp.net core and I came across a piece of code which I just can't understand what it means. I was reading docs to find some similar examples, but couldn't find anything.
public class Startup
{
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration get;
Why inside class
Startup
there is another keywordStartup
? if that's a method, then why it starts with capital?Why there is
IConfiguration
interface in front ofConfiguration
? Shouldn't it be after, like:IConfiguration
? And why is there empty body definition if it's not abstract function? Thanks.
c# asp.net-core
So I began to learn c# and specifically asp.net core and I came across a piece of code which I just can't understand what it means. I was reading docs to find some similar examples, but couldn't find anything.
public class Startup
{
public Startup(IConfiguration configuration)
Configuration = configuration;
public IConfiguration Configuration get;
Why inside class
Startup
there is another keywordStartup
? if that's a method, then why it starts with capital?Why there is
IConfiguration
interface in front ofConfiguration
? Shouldn't it be after, like:IConfiguration
? And why is there empty body definition if it's not abstract function? Thanks.
c# asp.net-core
c# asp.net-core
edited Mar 28 at 0:32
SO used to be good
21.4k6 gold badges43 silver badges74 bronze badges
21.4k6 gold badges43 silver badges74 bronze badges
asked Mar 28 at 0:13
LimpulsLimpuls
3761 silver badge17 bronze badges
3761 silver badge17 bronze badges
closed as too broad by mjwills, John, SO used to be good, BACON, gnat Mar 28 at 9:34
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by mjwills, John, SO used to be good, BACON, gnat Mar 28 at 9:34
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by mjwills, John, SO used to be good, BACON, gnat Mar 28 at 9:34
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Thispublic Startup(IConfiguration configuration)
is the constructor of the classStartup
and receives an object that implements the interfaceIConfiguration
. Thispublic IConfiguration Configuration get;
is a property with a getter so client code can access theIConfiguration
object.
– dcg
Mar 28 at 0:17
4
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
See some c# tutorials
– Alexander
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
1
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51
add a comment |
Thispublic Startup(IConfiguration configuration)
is the constructor of the classStartup
and receives an object that implements the interfaceIConfiguration
. Thispublic IConfiguration Configuration get;
is a property with a getter so client code can access theIConfiguration
object.
– dcg
Mar 28 at 0:17
4
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
See some c# tutorials
– Alexander
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
1
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51
This
public Startup(IConfiguration configuration)
is the constructor of the class Startup
and receives an object that implements the interface IConfiguration
. This public IConfiguration Configuration get;
is a property with a getter so client code can access the IConfiguration
object.– dcg
Mar 28 at 0:17
This
public Startup(IConfiguration configuration)
is the constructor of the class Startup
and receives an object that implements the interface IConfiguration
. This public IConfiguration Configuration get;
is a property with a getter so client code can access the IConfiguration
object.– dcg
Mar 28 at 0:17
4
4
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
See some c# tutorials
– Alexander
Mar 28 at 0:19
See some c# tutorials
– Alexander
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
1
1
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51
add a comment |
1 Answer
1
active
oldest
votes
This is the constructor, it's called when you use new Startup()
public Startup(IConfiguration configuration)
Configuration = configuration;
This is an autoproperty, it returns IConfigruation
and automatically implements a property Getter
public IConfiguration Configuration get;
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is the constructor, it's called when you use new Startup()
public Startup(IConfiguration configuration)
Configuration = configuration;
This is an autoproperty, it returns IConfigruation
and automatically implements a property Getter
public IConfiguration Configuration get;
add a comment |
This is the constructor, it's called when you use new Startup()
public Startup(IConfiguration configuration)
Configuration = configuration;
This is an autoproperty, it returns IConfigruation
and automatically implements a property Getter
public IConfiguration Configuration get;
add a comment |
This is the constructor, it's called when you use new Startup()
public Startup(IConfiguration configuration)
Configuration = configuration;
This is an autoproperty, it returns IConfigruation
and automatically implements a property Getter
public IConfiguration Configuration get;
This is the constructor, it's called when you use new Startup()
public Startup(IConfiguration configuration)
Configuration = configuration;
This is an autoproperty, it returns IConfigruation
and automatically implements a property Getter
public IConfiguration Configuration get;
answered Mar 28 at 0:17
JStewardJSteward
4,7072 gold badges10 silver badges20 bronze badges
4,7072 gold badges10 silver badges20 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
This
public Startup(IConfiguration configuration)
is the constructor of the classStartup
and receives an object that implements the interfaceIConfiguration
. Thispublic IConfiguration Configuration get;
is a property with a getter so client code can access theIConfiguration
object.– dcg
Mar 28 at 0:17
4
I'd suggest googling 'what is a constructor C#' and 'what is a parameter C#' and 'what is a readonly property C#'. As is, I vote to close since your question is in fact multiple questions - meta.stackexchange.com/questions/39223/… . This is not an attack on you - just that you should write multiple questions to avoid the 'Person A writes a good answer to the first question and Person B writes a good answer to the second question' problem. If they are separate questions, you can pick the best answer for the two questions independently.
– mjwills
Mar 28 at 0:17
See some c# tutorials
– Alexander
Mar 28 at 0:19
Constructors docs
– John
Mar 28 at 0:19
1
I think a more effective way to learn C# (or any language) would be to start with the documentation or a book rather than diving into code and asking "What's this? What's that?" You'll have a hard time searching for or asking about these concepts (as we see here) if you don't know what they're called, and the fact that these are such really, really basic concepts in C# suggests you're trying to (and, no offense, failing to) learn in the wrong direction, working backwards from code instead of forwards from concepts.
– BACON
Mar 28 at 0:51