Posts

Image
 Triggers in SQL  Before vs instead of vs after  In this article, we will talk about triggers, their types, use cases, pros and cons of each one. what are triggers in general? Triggers are special types of stored procedures that automatically execute when certain events occur in the database ---------------------------------------------------------------------------------------------------------------------------- Before Trigger  Is a trigger executed before specific events [insert-update-delete] Pros 1-Prevent invalid data from being inserted or updated by raising exceptions. 2-Modify values to be inserted or updated before the actual operation occurs. Cons  1 it can cause additional processing overhead before the main DML operations 2-it can be complex to manage, especially with multiple triggers on a table. Use Cases Validating or modifying the data before main DML operations ------------------------------------------------------------------------------------...
Image
 MVC VS Web API Today we will talk about the differences between two architectures we use in developing web apps, the pros, cons, and use cases of each one. First, let's start with MVC : What is MVC?  MVC stands for Model-View-Controller  which is an architecture or we can consider a design pattern  consists of these interconnected components we mentioned before, if we would explain the meaning of the three components very briefly  1-Model : where we set the logic of our app like the entities, 2-View : from its name is the place where we set the frontend of the project 3-Controller : where we set the connection between the logic and the frontend [Model & View] What are the Pros of MVC? 1-Easy Integration Integrates well with other .NET Core features like Razor Pages, Entity Framework Core, and Identity. 2-SEO-Friendly because MVC renders HTML on the server side, it's easier to create SEO-friendly pages. 3-All in one Place You have the two aspects of the web ...
Image
 Database first vs Code first  In this article, we will discuss two approaches in the entity framework for creating a database  we will discuss the pros, cons, and use cases of each one       Database-First what is database-first? simply this approach means starting with the existing database and using entity framework to generate entity classes based on the database  what are the pros of using database-first approach? 1-Minimum Errors:   because the entity classes are generated from the database schema, there's less chance of introducing errors through typos or inconsistencies between your code and the database.  2-  Integration with Existing Systems if you work with legacy systems or integrate with external databases, You can modify the existing database structure and generate the necessary Entity Framework components for seamless interaction. 3-visual design  Entity Framework tools provide a visual designer that allows ...
Image
Hello, This is my first article in the series named Similarities, where I discuss the difference between two different technologies or methods or patterns, etc, but have nearly the same functionality. Identity column vs Sequence in SQL Identity Column what is the identity column? The identity column is a numeric column in the table, enabling auto integer values to be generated every time the row is inserted, it is mainly filled with integer values but it can be filled with other  datatypes like bigint,smallint, tinyint, or decimal as long as the scale is 0. why use the identity column? because it saves you time  adding  repeated numbers in famous columns like id  How can we apply the identity column? first, select the database from MSSMS second, choose the database and column where you want to apply identity  third check the identity specification Sequence  What is the  Sequence ? A sequence is an object in SQL Server (Transact-SQL) that is used to gen...