Global exception handling is a way to handle unhandled exceptions in asp.net core. Add a middleware UseExceptionHandler to the pipeline that will catch exceptions, log them, reset the request path and re-execute the request. The request will not be re-executed if the response has already started. Add UseExceptionHandler code in Startup.Configure method as stated below. Continue Reading »
The TempData provider cookie isn’t essential. CheckConsentNeeded is used to get user permission to enable cookies. If user has denied cookies then TempData cookies will not be provided to browser. In Asp.Net Core 2.1 to enable TempData cookies disable the CheckConsentNeeded option in Startup.ConfigureServices method. Asp.Net Core 2.2 has provided a new feature to configure the Continue Reading »
In dotnet core default case for serializing output to json is camelCase. We can change the default case to Pascal by setting the new DefaultContractResolver Steps Go to Startup.cs class file. Find Startup.ConfigureServices method and add the below line of code.
To get this work in Firefox. Try it
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
To update a list from another list, Here is the Syntax. Syntax Example 1. Create Student model 2. Create Student List as listStudents 3. Create Student Marks as listMarks 4. Now Update listStudents from listMarks
Convert a list of string to Comma Separated String. String.join method is used to concatenate a list of string, Using a specified separator between each string. Syntax : String.Join(string Separator, String Values); Example :