8 Reasons why .NET should be used for ERP software development
The impact of an ERP software system with a global market value of $41.69 billion at the start of 2021 was remarkable, and these statistics explain why it has been crucial for global...
Kapil Panchal - December 24, 2020
Listening is fun too.
Straighten your back and cherish with coffee - PLAY !
ASP.NET core is a popular framework for building web apps on the .Net platform. As we know Asp.net Core is a cross-platform, provides a high-performance, and's an open-source framework for building modern, cloud-based, internetconnected apps. Asp.net Core supports the JavaScript Framework, Cross-platform supports, provides In-built Dependency Injection, MVC Architecture, and Razor syntax.
In ASP.NET core updates they have included the two new releases .NET 5.0 Release Candidate 1 and, Net 5.0 Release Candidate 2. To use it, we need the latest version of the visual studio.
.NET 5.0 includes many improvements like single file application, smaller container image, capable of JsonSerialize APIs, and set of null reference type annotation. Performance has been improved in .NET libraries in GC, and JIT. It also includes the newest version of language C# 9 and F# 5.
BlazorWebAssembly performance improvements
Blazor component virtualization
BlazorWebAssembly pre-rendering
BlazorWebAssembly browser compatibility analyzer
Blazor java-script isolation and object references
Custom Validation class in Blazor
Blazorontoggle event support
Model binding DateTime in UTC
Control start up class activation
SignalR parallel hub invocation
And many more functionalities in Blazor and for API project.
In C# 9, Records are the most important new feature. Records are as immutable classes and it has the tuple like feature. Using records, it is easy to use small types and take advantage of type safety throughout the application.
Records enable you to create immutable types. It will store a small amount of data.
The following example illustrates the example of a record. It stores the information from the login view.
Public record UserLogin(string user Name, string user Password);
Following class and above records are semantically similar to each other.
Public class UserLogin { Public UserLogin(string user Name, string user Password) { UserName = user Name, UserPassword = user Password } Public UserName{ get; init;} Public UserPassword{ get; init;} }
Init is a new keyword that is an alternative to the set. Where set allows you to assign to a property at any time whereas init allows you to assign to a property only during object construction. Any type can use the init keyword.
Record equality is based on content and class equality is based on object identity. Records provide the GetHashCode() implementation which is based on record content. Records provide an IEquatable implementation and it uses the unique GetHashCode() behavior.
System. Text. Json has been also improved in .NET 5. It will improve performance, reliability, and make it easier who are familiar with Newtonsoft.json. It also supports the deserialization of JSON object to C# records which is the new C# feature we have discussed earlier.
JSON Serializer extensions are now uncovered on HttpClient, this method removes the complexity and takes care of a variety of scenarios. It handles the content stream and validating the content media type.
In .NET 5 they have made improvements in Blazor Web Assembly run time performance. Blazor Web Assembly in .NET 5 is 3 times faster than Blazor Web Assembly in .NET 3.2 due to optimization in the core framework libraries. In these, string comparisons, dictionary lookups, and JSON handling are faster in .NET 5 Blazor Web Assembly than .Net 3.2.
Using the new built-in virtualization support, we can improve the performance of component rendering. It is the process or technique for limiting UI rendering, like when you have more rows in the table and it will show only a small subset at any given time. For that Blazor introduced the new component Virtualize that can be used to easily add virtualization to our component.
For the table component, we might use the C# foreach loop to show each item in the row.
@foreach (var forecast in forecasts) { }
Date | Temp. (C) | Temp. (F) | Summary |
---|---|---|---|
@forecast.Date.ToShortDateString() | @forecast.TemperatureC | @forecast.TemperatureF | @forecast.Summary |
If in this table, we add thousands of items then it will take a bit long time to render. Instead of foreach use the Virtualize component as shown below.
Date | Temp. (C) | Temp. (F) | Summary |
---|---|---|---|
@forecast.Date.ToShortDateString() | @forecast.TemperatureC | @forecast.TemperatureF | @forecast.Summary |
The virtualize component calculates how many rows to be rendered based on the container height and size of the rendered items.
If you do not want to load all items into memory, so do this.
@forecast.Date.ToShortDateString() @forecast.TemperatureC @forecast.TemperatureF @forecast.Summary
Item Provider is a delegate method that asynchronously retrieves the requested rows or items on demand.
For prerendering a component from a blazor web assembly the component tag helper supports the two render modes:
It prerenders the component into a static HTML and includes the marker for a Blazor Web Assembly app to make an interactive component when loaded in a browser.
The component is not prerendered, includes the marker for a Blazor Web Assembly app to make an interactive component when loaded in a browser.
WebAssemblyPrerendering: -
Web Assembly: -
To set render mode open the host. Cshtml and in the render mode place the WebAssemblyPrerendered.
Blazor now offers an Input File component for handling file uploads as shown below.
It is just like the HTML input type “file”. By default, the user can input one file and you can add more than one file using multiple attributes.
Blazor also supports CSS isolation in this release. The bundle name is now as per the project name like {project name}. style.css. In .NET 5.0 each bundle can be referenced from the root path.
We can also use the component specific styles which use normal wwwroot- relative paths to refer to related assets like following code.
.classSelector{ color:aqua; border:dashed; padding:2px; background-image: url('some.webp'); }
We have discussed the new .NET 5.0 updates in Asp.Net core which improves the performance, component virtualization, JavaScript isolation, CSS isolation, Input file support, Custom Validation class attribute, Control start-up file activation, Open API specification (swagger), F5 experience in .NET core API, SignalR parallel hub invocation, and more. Have you noticed, mostly, everything is updated in the Blazor Web Assembly? They have focused on Blazor for more improvement and provides some components which are used to make attractive UI like CSS improvements with Bootstrap framework.
Build Your Agile Team
The impact of an ERP software system with a global market value of $41.69 billion at the start of 2021 was remarkable, and these statistics explain why it has been crucial for global...
The Airline industry is rapidly expanding and strives to be more productive and efficient. Technology advancement has completely changed the corporate world, and the Airline industry...
The Aviation industry is experiencing a ground-breaking change with the waves of technological advancements. The transformations with eclectic ideas are creatingwonders in the airport...