It is a quite usual case when you have a set of the child items of some parent one (order positions for instance) and need to update this set constantly. And “update” means insert, update, and delete at once. Of course, you can manually check which items already exist in the database and update them, which ones should be either created or deleted, but it needs a lot of SQL code and doesn’t look pretty. And it produces ineffective and slow queries.
If you are using a full-featured ORM (like Entity Framework) you can just rely on it and ignore this problem, because obviously it is somehow done automatically. But if you need to use a lightweight ORM (Dapper or so), and if you are using Microsoft SQL Server, let’s look at the better solution.
Currently I’m working on the new project (basically, this is one of the reasons I write so few articles now). It is food delivery automation system (I own the pizza delivery company located in Kyiv, my hometown; some kind of hobby). It contains the point of sale applications, one of them is web-based. And, as any other POS application, it must print receipts using a thermal POS printer.
Today I will show how to make printing from a web page to a POS (thermal or any other) printer quick and simple:
Hi! Let’s discuss why it is (or might be) still a good idea to use the Unit of Work and Repository patterns with the Entity Framework Core, while it already implements these patterns itself.
This time we will see how to setup the MVC routing system to get culture as the URL segment:
Today we have a very interesting topic to discuss. We will discover and test how different decisions, solutions, and approaches affect the ASP.NET Core web applications performance. We will talk about small and simple things that sometimes are forgotten (and will measure their impact). A huge amount of computing resources is wasted again and again due to unnecessary operations and suboptimal algorithms, and our web applications work much slower than they could. Let’s see what we can do.
Today we are going to create simple website you can use as your personal one using the Platformus CMS (it is based on ASP.NET Core and ExtCore framework). You even don’t have to be a developer, we will not write any code for now. The resulting website (that can run on the different platforms, even without standalone web server) will look like this:
Time after time, using Entity Framework Core, we might need to execute raw SQL query to count something in our database (or to use other aggregation function). And while using raw SQL queries to select entities is simple, executing aggregation function is a bit more complicated and needs some “low level” classes, like SqlConnection, SqlCommand, and DbDataReader (class names are a bit different for the different databases, these ones are for the SQL Server).
In some reason, you might want to avoid using standard Identity package to work with users, roles, permissions etc. I had 2 reasons:
- Identity works only with Entity Framework (unless you write your own implementation of the IUserStore interface), but in my project (content management system) I didn’t want to limit future users in this way;
- it is too huge and complicated, I don’t want to have all that features I will never use.
That’s why I decided to write my own. But I had to replace only user/role/permission management, while the standard ASP.NET Core sign in/sign out features had to be still in use.
We will write simple web application that will have its own user manager to validate, sign in (using the standard ASP.NET Core implementation), and sign out users. It will use SQLite database to store related information and Entity Framework as the ORM, but it is easy to replace it with any other storage and ORM you want:
Today we are going to create small accounting web application which will consist of 4 extensions: Barebone, Incomes, Expenses, and Balance. UI and data model will be also modular. The result will look like this:
Today we will create relatively complicated ASP.NET Core tag helper. It will be a custom drop down list with both server side and client side logic. The result will look like this:
This time I want to show how easy it is to use CoreCompat.System.Drawing image processing package to crop the images in ASP.NET Core. We will create simple web application with the only one controller and action. This action will download the source image, crop it using the given parameters, and write resulting image to the response stream.
We are going to show how simple it is to create a web application with modular (built from the parts from the different modules and extensions) user interface using the ExtCore framework:
This is clear and simple example that demonstrates how to upload files in ASP.NET Core with a progress bar without using any third-party client side technology (like Flash):
We are going to create extremely simple modular ASP.NET Core web application using the ExtCore framework. It will do nothing except calling the methods (and displaying the returned values) of the objects, that are automatically instantiated by ExtCore using the types, defined inside an external module. That module might be included as an explicit dependency or as a DLL file.