Posts

Showing posts from April, 2021

C# .Net Core Interview Questions for Freshers and Experienced Developers

  C#, .NetFramework, .Net Core interview Questions For Angular and SQL Interview Questions, click here...! 1. IOC (Inversion of Control) Container in .NET Core The IOC container in .NET Core is responsible for managing object creation and their dependencies. It's used for Dependency Injection (DI), making it easy to manage lifecycles (transient, scoped, singleton). Example of registering a service: public void ConfigureServices(IServiceCollection services) {     services.AddScoped<IMyService, MyService>();  // DI registration } 2. Configure and ConfigureServices - When to Use What ConfigureServices: Used to register services with the dependency injection container. Typically includes services like database context, authentication, and MVC. Configure: Used to define the middleware pipeline (how requests are processed). Example: public void ConfigureServices(IServiceCollection services) {     services.AddControllers();     services.AddDbContex...