Posts

Showing posts with the label Razor

Configuration Model in c#

Configuration Model in c# , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE  Configuration Model Configuration data should live outside the application. If you feel the urge to hardcode something, stop and think about the impact it may have on the scalability of the application in the future. When we separate the configuration from the application, it allows us to deploy the same code to do different things in different environments  There is a saying " Don’t code hard, hardcode instead.” As .NET developers, we should be familiar with the good old app.config and web. config files, which offer a mechanism for a specific configuration for each application. ASP.NET Core is no different, but with a much better mechanism for storing and providing configuration data. In fact, the new configuration model in ASP.NET Core is much more simplified, flexible, and extendable. Compared to its predecessors, it sets the bar quite high. In laymen’s terms, i

MVC Pattern

Image
MVC Pattern , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE                                                              Introduction This chapter will focus on the implementation of the MVC pattern within ASP.NET Core, specifically from an API perspective as a fully functional web framework. We will explore how data are mapped from HTTP requests and bound to action parameters and strongly typed models, as well as how these models are validated before any data processing happens. At the end of this chapter, we will also have a broader understanding of how controllers work and grasp the importance of action methods to handle incoming requests. We will learn all about filters and how they can help by executing code before and after the processing of requests in the pipeline. Returning the appropriate responses is crucial in APIs, and formatting these responses is essential when dealing with many different types of responses. In this chapter, we wil

Extensibility Architecture API

Image
Extensibility Architecture API , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE Extensibility Architecture API  Extensibility Architecture API This chapter will explain some of the essential aspects of ASP.NET Core from an extensibility point of view. We will learn more about hosts and servers, as well as about creating a custom server. We will revisit the concept of middleware, delving deeper into more advanced scenarios. As mentioned before, RESTful APIs deliver resources located on a specific URI, which can be driven by routing. We will also learn more about routing from a practical standpoint. In the last section of this chapter, we will cover hosting services, which are used for running concurrent background tasks within an ASP.NET Core application. Hosts and Servers The concepts of hosts and servers play a vital part in the RESTful architecture. We can implement a host with a server that listens for remote requests by clients in ASP. NE