Trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected. For more information Types of DML Triggers AFTER trigger AFTER triggers are executed after the action of the INSERT, UPDATE, MERGE, or DELETE statement is performed. AFTER triggers are never executed if a constraint violation occurs INSTEAD OF trigger INSTEAD OF triggers override the standard actions of the triggering statement. Therefore, they can be used to perform error or value checking on one or more columns and the perform additional actions before insert, updating or deleting the row or rows. For example, when the value being updated in ...
ADO.NET entity is an ORM (object relational mapping) which creates a higher abstract object model over ADO.NET components. So rather than getting into dataset, datatables, command, and connection objects as shown in the below code, you work on higher level domain objects like customers, suppliers, etc. DataTable table = adoDs.Tables[ 0 ]; for ( int j = 0 ; j < table.Rows.Count; j++) { DataRow row = table.Rows[j]; // Get the values of the fields string CustomerName = ( string )row[ " Customername" ]; string CustomerCode = ( string )row[ " CustomerCode" ]; } Benefits of using EF The main and the only benefit of EF is it auto-generates code for the Model (middle layer), Data Access Layer, and mapping code, thus reducing a lot of development time. The importance of EDMX file in Entity Framework EDMX (Entity Data Model XML) is an XML file which contains all the mapping details of how your objects map ...
In ASP.NET MVC, controllers define action methods that usually have a one-to-one relationship with possible user interactions Sometimes you want to perform logic either before an action method is called or after an action method runs. To support this, ASP.NET MVC provides filters. Filters are custom classes that provide both a declarative and programmatic means to add pre-action and post-action behavior to controller action methods. ASP.NET MVC Filter Types Authorization filters . These implement IAuthorizationFilter and make security decisions about whether to execute an action method, such as performing authentication or validating properties of the request. The AuthorizeAttribute class and the RequireHttpsAttribute class are examples of an authorization filter. Authorization filters run before any other filter. public class CustomAuthorizationAttribute : FilterAttribute, IAuthorizationFilter { void IAuthorizationFilter.OnAuthorization(Authoriz...
Comments
Post a Comment