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;








-4















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;


  1. Why inside class Startup there is another keyword Startup? if that's a method, then why it starts with capital?


  2. Why there is IConfiguration interface in front of Configuration? Shouldn't it be after, like :IConfiguration? And why is there empty body definition if it's not abstract function? Thanks.










share|improve this 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.



















  • 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





    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

















-4















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;


  1. Why inside class Startup there is another keyword Startup? if that's a method, then why it starts with capital?


  2. Why there is IConfiguration interface in front of Configuration? Shouldn't it be after, like :IConfiguration? And why is there empty body definition if it's not abstract function? Thanks.










share|improve this 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.



















  • 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





    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













-4












-4








-4








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;


  1. Why inside class Startup there is another keyword Startup? if that's a method, then why it starts with capital?


  2. Why there is IConfiguration interface in front of Configuration? Shouldn't it be after, like :IConfiguration? And why is there empty body definition if it's not abstract function? Thanks.










share|improve this question
















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;


  1. Why inside class Startup there is another keyword Startup? if that's a method, then why it starts with capital?


  2. Why there is IConfiguration interface in front of Configuration? 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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.














  • 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





    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






  • 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












1 Answer
1






active

oldest

votes


















1















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; 





share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1















    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; 





    share|improve this answer





























      1















      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; 





      share|improve this answer



























        1














        1










        1









        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; 





        share|improve this answer













        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; 






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 0:17









        JStewardJSteward

        4,7072 gold badges10 silver badges20 bronze badges




        4,7072 gold badges10 silver badges20 bronze badges





















            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.





            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript