Goal
This tutorial shows how to connect an MVC module to SQL Server through Dapper and stored procedures. The pattern is useful for enterprise-style applications that avoid Entity Framework.
Repository pattern
var command = new CommandDefinition("USP_M_CLIENT_MANAGE", parameters, commandType: CommandType.StoredProcedure);Steps
- Create table and stored procedure.
- Create domain model and form view model.
- Add repository methods.
- Call the repository from a service.
- Use the service from an MVC controller.
Quick feedback
Was this helpful?
Your feedback is saved in this browser.