There are different types in C# such as class,interfaces and enums.One of the reference type is delegate.Delegate allows to define objects which can point to a function.This makes it convenient to define decoupled application and pass function as a parameter value to other functions. For example if you define a delegate called ProcessDelegate then you […]
Archives for August 2019
Router Guard in Angular
Route Guards determine whether to allow or deny navigation within Angular application. There are 4 types of routing guards in Angular: CanActivate Determines if a route can be activated CanActivateChild If route children can be activated CanLoad If lazy loaded child routes can be loaded. CanDeactivate Determines if the user can navigate away from route […]
Using dotnet publish command
The dotnet publish command compiled the dotnet core application and writes the output to a folder.The contents of this folder could be deployed.So effectively dotnet publish command publishes the compiled output along with the application dependencies.If you are in the root folder of your application then you can issue the command dotnet publish this will […]
ASP.NET Core dependency injection
What is Dependency Injection in ASP.NET Core ASP.NET Core provides a simple prebuilt DI container.We need to register the dependencies in this container.Dependencies could be the custom classes or the framework classes Once you have registered the dependency in the container you can inject it anywhere you need.The DI container will automatically inject the dependencies […]
Creating WebAPI in ASP.NET Core
What is WebAPI WebAPI in .NET Core is used for creating RESTful services.WebAPI in .NET Core is a class which derives from the ControllerBase class.This is unlike MVC controller which derives from Controller class.Controller class adds support for working with views. Different return types we can return the following from the controller action method: Specific […]