Enable CORS for dotnet core applications

By | Engineering | No Comments

From the W3C specification, A simple cross-origin request has been defined as congruent with those which may be generated by currently deployed user agents that do not conform to this specification. Simple cross-origin requests generated outside this specification (such as cross-origin form submissions using GET or POST or cross-origin GET requests resulting from script elements) typically includeuser credentials, so resources conforming to this specification must always be prepared to expect…

Read More

dotnet watch (like nodemon for NodeJS)

By | Engineering | No Comments

Updated July 1, 2018 With the release of dotnet core 2.1.3, they have built in the following dotnet tools. Watch is one of them. So to get started just create a project or upgrade a project to 2.1.3 and then simply add a ‘watch’ after your dotnet app and before the command. dotnet watch run nodemon is used in NodeJS…

Read More

dotnet DI Dependency Injection – Transient, Singleton, Scoped (per Http Request)

By | Engineering | No Comments

With dotnet’s built in Dependency Injection (DI), you have the choice to wire up dependencies with three different flavors of binding. Here’s a quick reference for how those bindings work. Transient Transient lifetime services are created each time they’re requested. This lifetime works best for lightweight, stateless services. services.AddTransient<IService, Service>(); Scoped Scoped lifetime services are created once per request. services.AddScoped<IUsersService,…

Read More