I am using Entity Framework and I have a question about performance.
Here is my linq add method:
CarTable newCar = new CarTable()
{
CarPlate = plate,
CarModel = model,
CarColor = color,
CarImage = image
};
entity.CarTable.Add(newCar);
entity.SaveChanges();
And here is a stored procedure for the same purpose:
CREATE PROC prCreateCar
(@plate NVARCHAR(20),
@model NVARCHAR(50),
@color NVARCHAR(10),
@image NVARCHAR(MAX))
AS
BEGIN
INSERT INTO CarTable
VALUES (@plate, @model, @color, @image)
END
And calling it from asp.net with this:
entity.prCreateCar('34 F5 3498','Renault Clio','Blue','Images/Cars/clio.png');
Both of them working fine but here is my question.. which one gives better performance? I heard that stored procedures are faster but is it true? If it is true, is it faster in all conditions like SELECT, DELETE, UPDATE and INSERT ?