July 2019
Intermediate to advanced
416 pages
10h 6m
English
So, what does our Startup class actually look like? Well, in a similar fashion to the way we have been developing with TypeScript, C# starts with the class definition:
public class Startup{}
Unlike JavaScript, C# does not have a special constructor keyword. Instead, C# uses the name of the class to represent the constructor. Note that, just like JavaScript when we create our constructor, we don't give it a return type (we'll see how C# deals with return types shortly). Our constructor is going to receive a configuration entry to allow us to read the configuration. We expose this as a C# property using the following get; property:
public Startup(IConfiguration configuration){ Configuration = configuration;}public IConfiguration ...Read now
Unlock full access