In this article we will focus on accessing data only using Stored Procedure using Entity Framework.
Download source code 7.86 MB
What does Repository mean?
Dictionary meaning: A place where things may be put for safekeeping.
The Repository Pattern allows to centralise all data access logic in one place. It is a common construct to avoid duplication of data access logic throughout our application. The Repository pattern adds a separation layer between the data and business layers of an application.
Generic Repository Pattern:
A generic(relating to) repository is often used with the ORM(entity framework) to speed up the process of creating a data layer.With generic feature, we can reduce the amount of code we need for common scenarios.
interface IRepository<T> : IDisposable where T : class
T GetById(object Id);
void Insert(T model);
void Update(T model);
void Delete(object id);
In this article we will learn basic CRUD operation using Web Api-2, and Stored Procedure with a sample Desktop Application.
Let’s Create a Sample database named ‘SampleDB’ with SQL Management Studio. Using the ‘SampleDB’ now create a Table name ‘tblCustomer’.
CREATE TABLE [dbo].[tblCustomer](
[CustID] [bigint] NOT NULL,
[CustName] [nvarchar](50) NULL,
[CustEmail] [nvarchar](50) NOT NULL,
[CustAddress] [nvarchar](256) NULL,
[CustContact] [nvarchar](50) NULL,
CONSTRAINT [PK_tblCustomer] PRIMARY KEY CLUSTERED
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
In this article we will clarify our knowledge about using and posting a form with JQuery and Ajax.
Before dive into core topic let’s have an overview about JQuery and Ajax. What is it?
What is JQuery?
In This post we will learn Basic CRUD operation using ASP.Net MVC, JSON, ADO.Net, and Stored Procedure with a sample MVC Application.
Our first step is to create and design a SQL Database, below step’s we have the demonstration of creating a database table and very basic CRUD Stored Procedure. Read More