using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace EntityFrameworkBasics { /// /// A shorthand access class to get DI services with nice clean short code /// public static class IoC { public static ApplicationDBContext ApplicationDbContext => IocContainer.Provider.GetService(); } /// /// The dependency Injection container making use of the built in .Net Core service provider /// public static class IocContainer { /// /// The service provider for this application /// public static ServiceProvider Provider { get; set; } } }