Calling Stored Procedure "insert query" using EF 6, UOW, and MVC 5 I'm a beginner in MVC programming, repository, and UOW using Entity framework. I tried to calling my existing SP in my MVC project using UOW and EF.

Here is my code to mapping my SP in myDbContext file:

modelBuilder.Entity&lt;Applicant&gt;().MapToStoredProcedures(
            s =&gt; s.Insert(
                i =&gt; i.HasName("InsertApplicant")
                .Parameter(fn =&gt; fn.First_Name,"FirstName")
                .Parameter(ln =&gt; ln.Last_Name,"LastName")
                .Parameter(em =&gt; em.Email,"Email")
                .Parameter(tn =&gt; tn.Tel_No,"TelNo")
                .Parameter(mn =&gt; mn.Mobile_No,"MobileNo")
                .Parameter(vt =&gt; vt.Visa_Type,"VisaType")
                .Parameter(lu =&gt; lu.LinkedIn_URL,"LinkedInURL")
                .Parameter(ob =&gt; ob.Objective, "Objective")
                .Parameter(ac =&gt; ac.Active, "Active")));


And, below is the code I used to call the SP on my controller (i don't know if it's right or not):

using (var context = new MyExperienceDbContext())
            {
                var fn = new SqlParameter("@FirstName", entity.First_Name);
                var ln = new SqlParameter("@LastName", entity.Last_Name);
                var em = new SqlParameter("@Email", entity.Email);
                var pn = new SqlParameter("@TelNo", entity.Tel_No);
                var mn = new SqlParameter("@MobileNo", entity.Mobile_No);
                var vt = new SqlParameter("@VisaType", entity.Visa_Type);
                var lu = new SqlParameter("@LinkedInURL", entity.LinkedIn_URL);
                var ob = new SqlParameter("@Objective", entity.Objective);
                var ac = new SqlParameter("@Active", entity.Active);

                context.Database.ExecuteSqlCommand("InsertApplicant @FirstName,@LastName,@Email,@TelNo,@MobileNo,@VisaType,@LinkedInURL,@Objective,@Active ",
                    fn, ln, em, pn, mn, vt, lu, ob, ac);
                return RedirectToAction("Index");
            }


It works fine for me, but I noticed if I delete the mapping's code in myDbContext file everything still works fine. I believe i'm failed to implemented the UOW and repository concept in EF when calling my existing SP, right? 
Do you have any idea with my question above or do you have tutorial suggestion to calls SP using UOW and EF in MVC project?
Your mapping is designed to call a stored procedure when you call context.Applicants.Add() and context.SaveChanges(). Your second code manually calls a stored procedure, that is not what you want to do. Simply keep your mapping:

using(var context = new MyExperienceDbContext())
{
    context.Applicants.Add(entity);
    context.SaveContext();
}


Also this code does not belong in your controller, it belongs in your repository.

public interface IApplicantRepository
{
    void AddApplicant(Applicant applicant);
}


For a more advanced look at Repositories please read the first part of my article: http://www.lind-i.com/Docs/DataSelectorsWithMVVM.pdf