List of Posts
This is the complete list of categories of posts written under the category ASP.NET Core . They have been ordered by the publish date, with the most recent first.
14 Apr, 2023
This ASP.NET Core WebApi Project doesn't contain any razor pages. It has been written with a few minimal web api - a client browser connects to . . .
(ESP32 WROOM) Internet Of Things IOT based Switching
02 Mar, 2023
This ASP.NET Core Project is a proof of concept that allows us to control electrical switches in a building, or if it is extended, then it can be us . . .
(C# ASP.NET Core) Location Tracking Project in ASP.NET Core and .NET MAUI
10 Feb, 2023
This ASP.NET Core Project is a proof of concept that allows a user to keep a record of the locations that an android phone travels. The user has to . . .
(C# ASP.NET Core) Billing, Inventory and Shopping with BarCodes ASP.NET Core Project
09 Feb, 2023
Customers visit a retail store and use their mobile phone camera to scan barcodes to add items to their shopping cart. The shopping cart is held in . . .
C# ASP.NET Core Projects with Step-by-Step Explanation and SOURCE CODE
15 Dec, 2022
Get ALL these ASP.NET Core Projects with Source Code + step-by-step Video Explanation in $10 [INR Rs. 600]. A few to name - "Find a Doctor" . . .
(C# ASP.NET Core) Program Example on Data Display and FORM Update
01 Nov, 2022
(LEVEL IS BEGINNERS) Suppose there is a model called StudentData with properties ID, Name, School and Marks. Also suppose we already have a collecti . . .
(EFCore Best Practices) Batching in EF Core and Planning your Bulk Updates
27 Sep, 2022
EF Core uses batching to execute bulk updates in a single trip to the database. You can always fine-tune your code by carefully sequencing your stat . . .
(EFCore Best Practices) Stored Procedures and Secure Parameterization to Prevent SQL Injection attacks
26 Sep, 2022
Raw SQL queries and Stored Procedures can be executed with the FromSqlRaw extension. It is very common that these queries and procedures require par . . .
(EFCore Best Practices) Raw SQL with FromSqlRaw for Efficiency
24 Sep, 2022
Suppose your database team have already provided you an optimized query in SQL syntax. Or let's say you have a legacy, old setup that makes it c . . .
(EFCore Best Practices) Buffering and Streaming of Resultset
23 Sep, 2022
A query can first store the entire resultset into memory, and then use a foreach loop to process each item. Alternatively, it can stream each result . . .
(EFCore Best Practices) Lazy Loading and the n+1 problem
23 Sep, 2022
Lazy loading is a great O/RM pattern that AUTOMATICALLY loads dependent (child) data when it is first accessed. The delayed loading is both an advan . . .
(EFCore Best Practices) Comparison of Select, Projection, Tracking and Execution in Database
20 Sep, 2022
We shall use various methods to calulate the sum of prices of all the records in the items table. We will also take note of the times taken. Usually . . .
(EFCore Best Practices) Identify Slow Commands with Logging and Tags
19 Sep, 2022
EF Core provides logs that help us determine the time taken by a specific query to finish. The logs also display the actual SQL query that was execu . . .
(EFCore Best Practices) Set a SQL Server Project
19 Sep, 2022
In this tutorial we shall set a project to use SQL Server as our database. You can obtain this project from the downloads attached to this video. Bu . . .
(CORS C# ASP.NET Core) Practical Verification of Credential Cookies
25 Aug, 2022
In this tutorial, we have two applications - the first is an ASPNET Core application that implements a CORS policy to accept cookies from the second . . .
(CORS C# ASP.NET Core) Credential Cookies with Cross-Origin Requests
24 Aug, 2022
- Published: 22-Aug-2022In this tutorial, we learn how to set a CORS policy that will respond to a pre-flight OPTIONS request. This policy will specify the list of acceptable request headers, a list of acceptable HTTP methods and a duration value for the Access-Control-Max-Age header.
- Published: 21-Aug-2022Browsers consider some cross-origin requests as unsafe. For example, an HTTP PUT request is considered unsafe. A browser first queries the server if it accepts that type of verb or request or headers by sending an HTTP OPTIONS request, which is called a preflight request. In this tutorial, we learn some concepts regarding preflight requests.
- Published: 18-Aug-2022Static files are NOT accessible cross-origin if we call UseStaticFiles before UseCors. But if we reverse the order, every static file becomes accessible to permitted origins. So we have an all-or-none type of situation. CORS can either be disabled for every static file or disabled for none. This tutorial explains how to enable CORS for just a small subset of files, as done by the various CDN networks.
- Published: 16-Aug-2022An ASPNET Core application can permit cross-origin requests by adding "Access-Control-Allow-Origin" header to the HTTP response. Cross-origin requests are not allowed by default; they must be allowed explicitly. One way of doing it is by defining a suitable policy in the application pipeline. In this tutorial, we learn the steps required for this. We shall also learn how to define multiple policies so that each end-point can serve requests to its own set of origins.
- Published: 12-Aug-2022In the previous tutorial, we demonstrated how a browser blocks cross-origin calls. So you must surely be wondering why cross-origin requests to CDN-hosted CSS files and fonts succeed. What's behind that success? Why do browsers permit some requests and block others? In this tutorial, we examine the reasons behind this. It will help us allow cross-origin requests in our ASPNET Core apps!
- Published: 05-Aug-2022WebApi can be protected through social media authentication also. The first step is to obtain a client id and a client secret by creating an app on a social media platform. Then these values are used to configure authentication services for that platform. In this tutorial we present the sequence of steps required to gain authorization to a web api protected by google authentication.
- Published: 03-Aug-2022Social media based login provides a neat and user-friendly means of logging into your website. Users are more likely to trust this method because of the level of security provided by various social media platforms. It helps us simplify the sign-in process by delegating many complexities to social media platforms. In this tutorial we present a project that requires a user to login with his google account. Once he logs in, then he is shown his email-id, name and profile picture. We also explain persistence of cookie, i.e., how the user can be remembered, and also the signout scheme.
- Published: 02-Aug-2022Social media based authentication requires us to create an oauth app on a social media platform such as google, facebook, twitter, github. This app provides us a client id and a client secret key for use in various classes that provide social media integration. In this tutorial we have a walkthrough for creating an oauth app on the google cloud console. Steps for other social media are similar - so you can take them as an exercise.
- Published: 30-Jul-2022In this tutorial we present a C# console application that connects to the web api that we have done in the previous tutorial. This app will first obtain a JWT Token by sending it's login credentials in a basic authorization header, and then it will use that token in a bearer header to obtain authorization to the second api protected by JWT Authorization. Please go through the previous turorial where we have explained both the web apis.
- Published: 26-Jul-2022JWT stands for JSON Web Token. In its simplest form, JWT authentication is a two step process. First a client obtains a JWT token from the server. This token is signed with a secure key and encrypted with a standard encryption algorithm. It has an expiry date, and it contains a list of claims such as the user-id, user-role, his email, etc., The client obtains authorization to a web api by sending this token in an authorization header. In this tutorial we shall see a server side implementation of the code for generating a JWT token, and of protecting a web api.
- Published: 25-Jul-2022The recommended way of implementing a custom authentication scheme is by deriving a class from AuthenticationHandler and implementing the HandleAuthenticateAsync function. This makes the code systematic because the authentication and header parsing code now moves to a dedicated class. This approach also allows us to include multiple authentication schemes in the same project - for example you might want one web api to be authorized through basic authentication, and another one through a JWT based authentication, and yet your razor pages through a cookie based authentication. In this tutorial we implement the basic authentication scheme.
- Published: 23-Jul-2022Basic Authentication is not encourged by ASP.NET Core because login id and password are sent as plain text in the request header - it's vulnerable to XSRF also. So there are no readymade classes like we have for cookies based authentication. But what if your project still needs to allow basic authentication? Perhaps because your security requirements are not of extreme cutting-edge type? For that case we present a simple solution that helps you protect a web-api with basic authorization. It can be a lot safer with Basic Authentication if your communication is over https, and even better if XSRF measures are taken, which is beyond the scope of this tutorial.
- Published: 15-Jul-2022In this tutorial we examine how to write a web api that accepts an uploaded file and saves it to a server. We shall also present a C# console application that will post a file to that web api. Let's see how!
- Published: 10-Jul-2022BindAsync is a second method for custom binding of parameters. The first one - TryParse - is good for cases where the items are available in a single string - most ideally as in a query string, or a header value, or a route segment. However, if need a greater control over the binding process, then a more robust parameter such as the HttpContext is more suitable - and the BindAsync method does exactly that. It provides a signature that contains HttpContext as a parameter.
- Published: 27-Jun-2022Consider a web api that extracts parameters x, y and z from its query string and then uses these values to construct a Point object, say for example, by passing these data to a constructor of the Point class. This program can be made more readable by passing a single string of a comma separated list of three numbers, and then have that string directly parsed into a Point object. This technique of customized binding is the subject matter of this tutorial.
- Published: 25-Jun-2022ASP.NET Core provides certain "special" parameters that are always available to an api handler. These parameters are "utility" parameters like HttpContext, HttpRequest, HttpResponse, CancellationToken and ClaimsPrincipal. They do not need any attribute decorations like those for the query-string, header, body and route segments.
- Published: 24-Jun-2022Parameters of a web api can be obtained from the values in a request header also. For this an attribute called "FromHeader" is used to decorate a parameter, and it provides an easy access to the value contained in the header of that name. In this tutorial we shall learn how to bind a header to a web api parameter. For continuity please go through the previous tutorial where we saw how to bind a query string variable to a parameter.
- Published: 22-Jun-2022We have been obtaining our web api parameters from route templates. A route is not the only source of parameters - in fact the parameters can be obtained from a query string, header values and from the body of the request also. In this tutorial we examine how to obtain the parameters from a query string variable, and how to set the parameter as optional.
- Published: 17-Jun-2022So far, we have been writing all our minimal web api in the program.cs file. But this can become un-manageable and un-readable in a full blown project. We need a scheme for organizing our web api so that they can stay in a class of their own, inside a file of their own. We can even have a possibility of multiple classes - with each class containing all the related web api - those of a doctor in one file, whereas those of a patient in another. In this tutorial we have a brief look at the various possibilities, and finally I show an implementation of the scheme that I personally prefer.
- Published: 04-Jun-2022In this tutorial we shall test a POST Web Api - and create a new record. So we shall have to first establish a connection between httprepl and our web server, and, then we will have to post the json for the new record that we have to create on the server. Let's see how!
- Published: 03-Jun-2022Now its time to use httprepl for testing our web api. To begin with, we shall test a GET api. I shall assume that your httprepl is installed and ready. If things appear difficult, then you may have to go through the previous two tutorials for learning the basics of httprepl.
- Published: 01-Jun-2022Before we can execute and test any web api, we have to establish a connection between httprepl and our web server. If you are following this chapter, then you must have observed that each of our route templates starts with the segment "doctor". Technically, it is called an end-point. The objective of this tutorial is to learn how to connect to a server, and how to get a list of available endpoints, and how to finally navigate to a specific endpoint - which is "doctor" in our case. In the coming tutorials we shall make calls to the various types of web api that we have already added to our web api project.
- Published: 01-Jun-2022Http Repl is a command-line tool for testing web api. This tool targets the ASP.NET Core environment. Let's have a look at a brief introduction to this tool. We will also learn how to activate it in visual studio. And in the coming tutorials we shall use it to make a few web api calls.
- Published: 24-May-2022As you must have already seen in the previous tutorials, we have a WPF application that obtains a list of records from our ASPNET Core web api application, and shows them in a WPF datagrid. When a row of the datagrid is clicked, a dialog pops-up that shows a form for editing the record. The save button for this form is wired to a click event handler that makes a PUT call to a web api and updates the record. A delete button on the same form causes a call to a DELETE web api.
- Published: 18-May-2022This tutorial continues from the previous tutorial. We have discussed most of the parts there. So please go through the previous tutorial for a continuity. Now we shall call a POST WebApi from our Wpf Application, and create a new record.
- Published: 18-May-2022In this tutorial we shall learn how to call the various types of WebApi from a C# WPF application. I have already created a WPF application that obtains a list of records from our web api project and renders them in a grid. This is a GET web api request that queries a collection of records. The same WPF window has a form for creating a new record - and this is done with a call to the POST web api. When a user clicks a record on the WPF window, a dialog pops up that allows the user to update the record. This will be a call to the PUT Web Api. The same dialog has a delete button that makes a call to the DELETE Web Api.
- Published: 17-May-2022Let us now configure our WebApi project to add support for SwaggerUI. As we told earlier, SwaggerUI is provided by both SwashBuckle and NSwag. We can use either of the two - and I shall be using SwashBuckle.
- Published: 15-May-2022Swagger makes it easy to document the various Web Api exposed by your project. The summary of your API is maintained in a json based file called openapi.json. This document is the main document. It is an intermediate document that is used to create a web page called SwaggerUI - which shows all your web api in a colorful, human readable interface. Each web api can be immediately run and tested. It turns out that SwaggerUI is much more easier as compared to the Postman software.
- Published: 14-May-2022This tutorial explains how a POST web api can be called from a C++ WinRT application. I have created a WinRT console application that connects to, and posts a json string to a POST web api, and then obtains a string response from the application, and then parses the json contained in that string. The c++ project is available in your downloads.
- Published: 29-Apr-2022This tutorial explains how a GET web api can be called from a C++ WinRT application. I have chosen WinRT type because it contains a lot many pre-written functions that simplify internet access and json parsing. I won't be able to explain the details of a WinRT setup, so I have already created a WinRT console application that connects to our web api, and then obtains a string from the application, and then parses the json contained in that string. The c++ project has been provided in the downloads attached to this course.
- Published: 28-Apr-2022This tutorial explains how to modify a POST type of WebApi so that it doesn't over-post data. A POST WebApi receives a data object as a parameter, and then adds it to a database, and finally it returns an HTTP 201 Created response alongwith the json for the newly added object. We have already covered this in one of the previous tutorials and for a primer on over-posting, please refer a previous tutorial "Over-Posting in WebApi and a Solution with Data Transfer Object".
- Published: 25-Apr-2022If an API has to return a collection of records, and if we do not want entire objects transmitted, then we can use a Data Transfer Object to return a small subset of properties, just-the-required subset. For a primer on over-posting, please refer the previous tutorial "Over-Posting in WebApi and a Solution with Data Transfer Object".
- Published: 25-Apr-2022We have been working with a model class consisting of three properties - id, Name and Fees. All the three properties have participated and have been exposed in json communication through every Web Api that we have discussed and written in the past tutorials of this chapter. This is called over-posting. But what if there were a property such as an email address that we didn't want exposed? This tutorial presents a solution through the concept of a Data Transfer Object.
- Published: 23-Apr-2022An HTTP DELETE request is used for deleting a record. The Server sends a 200 OK response on successful deletion alongwith the item that was deleted. Alternatively, it can send 204 No Content if the deleted item is, or cannot be included in the response. Let us see the implementation in this tutorial!
- Published: 19-Apr-2022An Http PUT request is used to update an existing record. For this, a client has to send the unique id of the record along with the entire updated record. Partial updates are not done with a PUT type of Web Api. Partial updates are, rather, supported by an HTTP PATCH request. But that is not the topic of this tutorial. Today we shall focus on the Http Put type of Web Api.
- Published: 18-Apr-2022A web api of the POST type is used to create a new record. For example, if we have to create a new record of a doctor, then we have to use a POST api to send the relevant fields for creating a record.
- Published: 16-Apr-2022Postman is a software that can be used to easily and conveniently run and execute web api. It can be installed as a desktop application. The software offers a lot of functionality, but we shall be using a small part of that - relevant to just our web api needs.
- Published: 15-Apr-2022In this tutorial we shall add a web api of GET type that takes an ID as a parameter and returns a record for that parameter.
- Published: 13-Apr-2022In the previous tutorial we learned how to write a web api that accepts no parameters. We executed it to return all the records of a table. In this tutorial we shall add another web api that accepts a parameter and returns data on the basis of that parameter.
- Published: 12-Apr-2022In this tutorial we shall add a web api that allows us to get all the records of a table. Please do note, however, that such a query is never done in a real project - it is invariably qualified with some paramaters that return a lesser number of records.
- Published: 28-Mar-2022This tutorial starts with a beginner's introduction to the concept of web api. After that we create a basic structure of a project that will help us learn about various types of web api - which will be serially covered in the next coming tutorials.
- Published: 26-Mar-2022The purpose of this tutorial is to add the functionality that allows a user to disable his 2-factor authentication. For this we shall have to modify the _LoginPartial page so that the disable 2-factor authentication link is shown to him.
- Published: 18-Mar-2022Consider a user who has enabled 2-factor authentication as explained in the previous tutorial. Such a user is required to authenticate twice before he can access the pages of a website. The first authentication is through the common login page, and then immediately after that he is redirected to a second login page where he has to enter a validation code obtained from his Google, Microsoft or IOS authenticator app. The purpose of this tutorial is to complete the second login page - also called 2-factor login page.
- Published: 03-Mar-2022Two factor authentication gives additional security to a login process. But this type of authentication has to be specifically enabled by a user. For this he clicks a button to receive an authentication code or token. This token is provided by the asp.net core app. After that he installs an authenticator app from Microsoft, or from Google or from IOS Play Stores. Then he has to enter that authentication code into the authenticator app and receive a code from that app. This code is then entered into the asp.net core application, and the two factor authentication gets enabled. In this tutorial we shall add a razor page to enable two factor authentication.
- Published: 26-Feb-2022You must have seen on various websites that a user account gets locked if the user makes about three unsuccessful login attempts. The exact same functionality is supported by the Identity API also - and it is possible to configure the number of failed attempts before an account gets locked. If a lockout timespan is specified, then the account remains locked for that specific duration. The default value is 5 minutes, but it can be set to any value. The number of failed attempts and the clock are reset when a user performs a successful login.
- Published: 24-Feb-2022A sign out link allows a logged user to log out of your website. It is usually shown in the header of a page and close to the name of the logged in user. In this tutorial we shall learn how to implement this functionality.
- Published: 24-Feb-2022It is a good idea to show the user name of a logged user in the header of each page of a website. And, if the user is not logged in, then the login and register buttons can be shown instead. The best way to implement it is to use partial views in combination with layout pages. This tutorial explains the steps for this.
- Published: 19-Feb-2022In its simplest terms, a claim is a name-value pair used to verify authorization. For example, you may be authorized to access a page if a claim of name "my_role" and of value "admin" is attached to your identity. In this tutorial we learn how to configure a project for claim based authorization, and how to add claim based authorization to a page.
- Published: 16-Feb-2022We have seen in the previous tutorial that when a user fills the forgot password form, then he is emailed a link to the reset password page. The link contains a password reset code. Now, in this tutorial we shall add a page for reset password.
- Published: 13-Feb-2022Very often a user is unable to remember the password that he created for a website. In such circumstances, the forgot password link comes to his rescue - it is one of the most important links on a login form. And, in this tutorial we shall implement the functionality for a forgot password link. Let's proceed!
- Published: 11-Feb-2022As soon as a new user registers on a website, an account verification email or an sms is immediately sent to him. But it is possible that a user never receives the email, or perhaps he is unable to locate the email that he might have received a few days back. Such a user would ask for the confirmation link to be sent again. This means that we need a mechanism for resending an email to a user. This tutorial explains the steps needed to generate and resend the link to that user.
- Published: 10-Feb-2022Recall from the previous tutorial that in our program.cs file we have set SignIn.RequireConfirmedAccount = true. This prevents immediate login to a newly registered user. The user is compulsorily required to verify his account through an email or SMS sent to his phone. For this, a link containing a specially generated confirmation token is sent to him. When the user clicks this link then this token is verified on the server side, and the user is informed of the confirmation status.
- Published: 05-Feb-2022This tutorial shall continue from the previous tutorial where we have made a basic initialization, and we have also created a database to hold the data of our users. In this tutorial we shall make additional configuration to specify our login and access denied pages. We shall also add a restricted (or protected page) and verify that when an un-authenticated user tries to access it, then he is automatically redirected to the login page.
- Published: 24-Jan-2022We shall create an identity based project from scratch. Although, visual studio provides a scaffolding for all the various modules, but personally I find all that very difficult to integrate with my own projects and my own css files. That's the motivation for starting from scratch. It will be a series of tutorials. In this first tutorial, I shall add nuget packages, followed by an IdentityDbContext, and finally run a migration to create the database on local sql server.
- Published: 21-Jan-2022In the previous tutorial we read various properties of an appSettings configuration file. But there is a better method for reading complex properties - such as "Address" - that we read in the previous tutorial. This is done through the options pattern. Let us now read City and ISDCode of the Address property by using the options pattern.
- Published: 20-Jan-2022We have seen in the previous tutorials that appSettings json file can be used to configure log levels. But this is not the only use of this file - it can, as well, be used to store custom key value data that can be read anywhere in your application. It turns out that log levels are just one of the possible values - there is a lot more that can be done. In this tutorial we shall learn how to store some rudimentary data and then read it back on a razor page.
- Published: 20-Jan-2022This tutorial continues our previous tutorial where we learnt that if an application is running under development environment, then ASP.NET Core provides a UseDeveloperExceptionPage middleware that catches un-handled exceptions and provides a detailed information about the snapshot state of the application. But that feature is not recommended for production environment - a developer should provide a custom page to filter out the information that finally reaches the display. Let's learn how!
- Published: 12-Jan-2022We shall create an app using visual studio 2022, running .NET 6. The application will artificially throw an un-handled exception. Then we shall verify that if the application is running under development, then asp.net core automatically provides a safety net to handle this exception, and provides a detailed information about the error. But if the same application is in, say, production, then there is no developer exception page, and the application crashes midway, with no response sent.
- Published: 10-Jan-2022Logging helps in troubleshooting, it helps in audit, it helps in getting signals of an imminent application crash. This topic explains the terminology of a log message, and also explains how to configure an application for logging, and also how to observe a sequence of log messages.
- Published: 07-Jan-2022We learn about the finer details of launchSettings.json file. This file contains various launch profiles to start an application in various modes - such as InProcess, OutOfProcess and direct Kestrel. Visual Studio uses this file to populate a dropdown toolbar so that the application can be started in various modes at the click of a button. This allows for easier debugging and testing of an application.
- Published: 05-Jan-2022An ASP.NET Core application cannot directly accept requests from the internet. For this it needs a server that can face the internet and help it communicate with the calling client on the other side. This means that some sort of coupling is required with a server software. This tutorial discusses various possibilities. Discussion of the launchSettings file is reserved for the next tutorial.
- Published: 02-Jan-2022This tutorial explains about the various environments like Development, Staging and Production. We also explain how to set them by various methods and how to conditionally check for environments and perform settings.
- Published: 27-Dec-2021In this tutorial we learn that the recommended strategy for migrations is to migrate through SQL Scripts. We will also learn how to use ef core tools for generating the SQL scripts. The scripts can be fine tuned and reviewed for more accurate results.
- Published: 26-Dec-2021A real life project evolves over a period of time. This process necessitates additions and alterations to the model classes - properties are added, properties are removed, foreign key relations are established, modified, and even removed. All these changes require a matching change to the database structure. This is a challenging task especially when a project is live and contains critical data that must be preserved and protected against corruption and damage. In this tutorial we learn how the EF Core Migration Tools help us easily achieve migrations without writing a single SQL statement or query.
- Published: 24-Dec-2021In the previous tutorial we added the EF Core migration tools to our project. We shall now run our first migration to create a blank database and its tables by the code first approach. After that we shall use the SQL Server Object explorer for verifying that our database and its tables have indeed been created.
- Published: 21-Dec-2021We shall start by creating a simple asp.net core project. Then we shall add nuget packages for a database such as Microsoft SQL Server. After that we shall add a very rudimentary, basic model class, and a DbContext class for specifying the connection string to the built-in SQL Server Express of Visual Studio. Finally, we shall use the package manager console to add the command line tools for ef core migrations.
- Published: 20-Dec-2021In this tutorial we shall learn an introduction to the database migrations. This feature is provided by entity framework core through its command line tools.
- Published: 15-Dec-2021In this tutorial we shall first create a docker image of our "Find a Docker" project. After that we shall publish that image to the DockerHub registry of the hub.docker portal. We suggest that you should first go through the chapter "Docker Containerization". That will help you understand the finer detail of docker images, docker containers and the steps for publishing a docker image.
- Published: 14-Dec-2021In this tutorial we shall learn how to connect an ASP.NET Core application to a SQL Server image that is running inside a docker container. Some data is entered and later verified that the data indeed reached the SQL Server Instance.
- Published: 13-Dec-2021In this tutorial we shall learn how to pull and run the docker image of Microsoft SQL Server through the Docker Desktop program. In this same tutorial we shall establish a connection to this instance with the Visual Studio SQL Server Object Explorer.
- Published: 12-Dec-2021This is a walkthrough on uploading a docker image to the docker hub registry. We shall upload the same hellodocker project and then verify the uploaded image by visiting the docker hub portal.
- Published: 10-Dec-2021In the previous tutorial we were able to run an image in a docker container. The docker container provided a RW memory for our project and also for our sqlite database file. And, we noticed that although the app was running fine, yet the data was not persisting between restarts of the container - it was not getting commited to a persistent store. Whenever we closed and restarted the app we found that the sqlite database started blank, with no data. In this tutorial we shall learn how to attach a virtual disk (or a volume) to your container so that data can persist on your hard disk, so that the data remains available on the next start of the container.
- Published: 09-Dec-2021This is a walkthrough on running a docker image. We start by explaining the commands for listing the docker images on a computer. Then we explain the commands for running a docker image, and for gracefully shutting down the container. Finally, we examine that when the images are run in this manner, the data is not persisted to disk.
- Published: 08-Dec-2021This is a walkthrough on creating a docker image with visual studio. We start by creating a simple asp.net core project with sqlite database connectivity, and then explain how Dockerfile can be easily created, followed by a docker image. We have included database connectivity because we shall use the same project for persistence with docker volumes later on.
- Published: 06-Dec-2021This article is a beginner's introduction to the terminology associated with docker files, docker images and containers. I have kept the explanation bare simple so that it's easy to get started. I have tried to explain the most basic questions like what is a docker, what is it's use for you, and what the basic terms mean in nutshell.
- Published: 05-Dec-2021These are the minimal steps for connecting to a Microsoft SQL Server database with EF Core. A simple application of one textbox form has been used to demonstrate how records can be inserted into a table in a SQL Server database. The tables and database are created automatically by EF Core on the basis of code first approach.
- Published: 01-Dec-2021(LEVEL IS BEGINNERS) These are practice questions and exercises on Areas and Partial Views in Razor Pages. Solve them and join our course for their solutions.
- Published: 01-Dec-2021These are the minimal steps for connecting to a MySQL database server with EF Core. A simple application of one textbox form has been used to demonstrate how records can be inserted into a table in a MySQL database. The tables and database are created automatically by EF Core on the basis of code first approach.
- Published: 29-Nov-2021Following are the minimal steps needed to run a hello world type of razor component that handles a click event. The component will have to be based on blazor because events have to be handled. The events are processed on the server side. If no events have to be handled, then these steps are not required - you should use render-mode=Static
- Published: 24-Nov-2021(LEVEL IS BEGINNERS) These are practice questions and exercises on Modularity in Razor Pages. Solve them and join our course for their solutions.
- Published: 23-Nov-2021Following are some of the reasons that you can consider when deciding on learning ASP.NET Core. I think .NET Core has a good future and in the coming days it is about to become the default web development technology. Write to us if you have something to add!
- Published: 09-Nov-2021(LEVEL IS BEGINNERS) These are practice questions and exercises on Basic database connectivity in Razor Pages. Solve them and join our course for their solutions.