NetCore Top questions

Post

New Post


Find by name:

NetCore First Name PostDate
Why Use ASP.NET Core for Web Application Development? Ans: ASP.NET Core is a robust, and feature-rich framework that provides features to develop super-fast APIs for web apps. Cross-platform: Runs on Windows, macOS, and Linux; can be ported to other OSes. The supported Operating Systems (OS), CPUs, and application scenarios will grow over time, provided by Microsoft, other companies, and individuals. Flexible deployment: Can be included in your app or installed side-by-side user or machine-wide. Runs on IIS or can be self-hosted in your own process. Built-in support for dependency injection. ASP.NET Core is cloud-ready and has improved support for cloud deployment. Provides Support for Popular JavaScript Frameworks. Unification Of Development Models which allows the MVC and Web API development models to use the same base class Controller. Razor Pages makes coding page-focused scenarios easier and more productive. Environment based configuration supported for cloud deployment. Built-in logging support. In ASP.NET we had modules and handlers to deal with requests. In ASP.NET Core we have middleware which provides more control over how the request should be processed as they are executed in the order in which they are added.
Can you explain Service Lifetime in AspNet Core? Built-in IoC container manages the lifetime of a registered service type. It automatically disposes a service instance based on the specified lifetime. The built-in IoC container supports three kinds of lifetimes: Singleton: IoC container will create and share a single instance of a service throughout the application's lifetime. Transient: The IoC container will create a new instance of the specified service type every time you ask for it. Scoped: IoC container will create an instance of the specified service type once per request and will be shared in a single request.
How to handle 404 error in ASP.NET Core 1.0 I found 2 ways to handle 404 error. In fact using these solution you can handle any HTTP status code errors. To handle the error, both the solution are using configure() method of Startup.cs class