Main Content

Please wait...

How to send the Email from Aspnet core?

Most of my project need common feature Sending Mail. In this article, we will learn how to send an email to given an email. We are using Mailkit that is available in NuGet. It is very simple. I am using Gmail SMTP. Create the new web project on Visual studio. Add Mailkit and MimeKit From Nuget. Mailkit MailKit is a cross-platform mail client library built on top of MimeKit. How to Add Mailkit in our project. Creating a project in visual studio. Right-click on your project name an ....Read More
Here is solution of: File Upload REST API using ASP.NET Core 3.0 Images Upload REST API using ASP.NET Core 3.0 Migrate Image API from ASP.NET Core 2.0 to 3.0 Migrate File API from ASP.NET Core 2.0 to 3.0 To build a REST service, We create an ASP.NET Core 3.0 Web Application project. Create new Project, Select Visual C#, Select Asp.Net Core Web Application, Provide suitable name, Click on OK Select API. And click on OK. Our Project look like this: Re ....Read More
Authentication refers to giving access to the specific system. It gives security from unwanted people from accessing data or site. ASP.NET core | SQL Stored Procedure | SQL SERVER | Encryption and Decryption | Authentication and Authorization Authorization refers to limiting the access of the system to the user according to their roles. There are different roles in an organization and we can provide access to the resources according to their position or role in the organization. There are ....Read More
ASP.NET Core, developed by Microsoft and the community is a free and open-source web framework and higher performance than ASP.NET. It runs on both the full .NET Framework, on Windows, and the cross-platform .NET Core. ASP.NET Core is the versatile framework and can be used to build all kinds of software including Web applications, Mobile apps, Desktop applications, APIs, Cloud services, Games, Microservices, and IoT applications. .Net Core 3.0 ASP .NET Core 3.0 is still in preview 7. This ....Read More
Get File Size in C#. How to get a file size in bytes using C# using the FileInfo.Length property. The size of any file in bytes can be returned by the Length property of FileInfo Class. Following code returns the size of file: // To Get size of any file long FileSize = MyFile.Length; Console.WriteLine("File Size in Bytes: {0}", FileSize); Here, to run it we must import System.IO and System.Text namespaces in the project. Coding Implementation Here is the complete coding impl ....Read More

JIT(Just In Time) Compiler in .NET

JIT(Just In Time) Compiler in .NET As we know that .Net Framework supports various Microsoft .Net Languages and all them use a Common Language Runtime rather than using a separate runtime for single one of languages. So, when .NET Common Language is installed in a computer it can support any language that is Microsoft .NET compatible. So, the purpose of JIT Compiler is to convert the .NET Language into the native code which is CPU specific. First the source code is converted to Intermediate L ....Read More
If your self hosted application acquired memory and it's not released then (or your core application lead to system out of memory), the tips in this post will help you. Once on my application what I had seen at the time of high traffic the memory acquired by ASP.NET Core application is not free and the server is running out of memory. To fix this issue my team and me started to find the problem in the application and after some hour of profiling, what we had seen there is not a b ....Read More

How to Trim the string in Model in Aspnet core?

How to Trim the string in Model in Aspnet core? Why trimming the text is important? Simply, because we don’t need any white space in a string. When you are doing any web project and implementing Rest API Service, we need to create a lot of forms, trimming every string value that the user supplied is time-consuming. So Here we have an easier and effective solution for the problem. First, we need the IModelBinder and IModelBinderProvider. Model Binder is now at a single place on inf ....Read More

Find prime porcupine number.

A prime number is an integer that is divisible by 1 an itself. A porcupine number is a prime number whose last digit is 9 and the next prime number that follows it also ends with the digit 9. For example 139 is a porcupine number because: It is prime It ends in a 9 The next prime number after it is 149 which also ends in 9. Note that 140, 141, 142, 143, 144, 145, 146, 147 and 148 are not prime so 149 is the next prime number after 139. Write a function name isproc() that take two inpu ....Read More

Find prime number between two range.

Write a function named prime count with a signature in int PrimeCount(int start, int end); the function print the prime number from the given range. Recall the prime is an integer greater than 1whose only integer factor is one or itself. if start is And end is reason 10 30 The prime between 10 to 30 are 11 ,13 ,17 ,19, 23 ,29. 11 29 The prime between 10 to 30 are 11 ,13 ,17 ,19, 23 ,29. 20 22 20,21,22 are all non-prime ....Read More