meh
Tuesday, March 31, 2020
.AddTransient (in C# and .NET Core) while handing in a variable
Per this, you could have:
services.AddTransient(x => new Yin("yang"));
...instead of...
services.AddTransient<Yin>();
And...
services.AddTransient<IYin>(x => new Yin("yang"));
...instead of...
services.AddTransient<IYin, Yin>();
I do not yet know what is going on with IOperationSingletonInstance here. I could not figure it out.
In .NET Core's IoC you may use .AddScoped and .AddSingleton as you might .AddTransient.
Singleton is always the same and transient frequently changing. Scoped is the same per request per this which I take to mean session of web site browsing.
#pragma hack to disable missing code comment alert in C#
#pragma warning disable CS1591
public static void Go()
#pragma warning restore CS1591
In Global.asax.cs in a .NET Framework application, you may hand static methods into GlobalConfiguration.Configure as the single inbound property at the Application_Start method.
The static methods you call elsewhere in code will each take an HttpConfiguration as the single inbound property.
Monday, March 30, 2020
Migrate .wsdl Web.config stuff from a .NET Framework project to a .NET Core project's appsettings.json file.
This has a pretty good example. You basically make one big JSON blob.