
Explore Dapper, the popular dotnet micro ORM, and learn to build a CRUD app with SQL using Dapper. Delve into contrib mappings and repository pattern, swapping Entity Framework with Dapper.
Explore the basics of dapper and orm concepts, then build a crud site with ASP.NET Core and Entity Framework Core, and replace it with dapper using SQL and stored procedures.
Dapper is a dot net micro orm that maps between the database and your objects for high performance, offering faster mapping than traditional orm with fewer features such as validations.
Adhere to the naming convention for models, views, and controllers to replicate exact spellings and simplify using provided snippets.
Find all course resources at dotnet mastery, including GitHub code with section-specific comments and downloadable course content. Use the dapper snippets for sections three to seven to save typing.
Learn to set up tools for the course using Visual Studio 2019 community or preview, and SQL Server, with .NET 5 or .NET Core 3.1 options.
Create an ASP.NET Core MVC web app in Visual Studio 2019 preview, enable Razor runtime compilation, and start fresh with a custom DbContext while reviewing Startup, Program, and wwwroot structure.
Configure the repository with Entity Framework to build a basic CRUD app, create a company model with six properties, set up a connection string, and prepare to migrate to Dapper.
Configure Entity Framework Core using NuGet package manager to install EF Core SQL Server tools in pre-release, create db context with a company DbSet, and wire connection string in startup.
Configure the startup class to wire services and add the application db context with sql server options. Read the default connection string from configuration and prepare migrations for the database.
Create a migration to add a companies table with columns name, address, city, state, postal code and an identity primary key in the Dapper database, then update the database.
Scaffold an mvc controller with entity framework to perform create, read, update, and delete operations on companies using the application db context and scaffolded views.
Implement an entity framework repository for companies, define ICompanyRepository with CRUD methods (find, get all, add, update, remove), and a concrete EF repository to execute these operations.
Convert the company controller to use a dapper repository via dependency injection, register ICompanyRepository, and implement get all, find, add, update, and remove with compRepo.
Implement the get all method in the Dapper repository by writing and executing a select star from companies query with Dapper, returning a list of company objects.
Learn to fetch one company using Dapper by applying a parameterized query and the single method, ensuring safe parameter handling and guarding against dependency injection attacks.
Demonstrate a Dapper create operation by inserting a company and returning its new id with scope_identity, then simplify by passing the whole company object.
Implement the update method to modify company records with a sql update, ensure correct company id usage, execute without retrieval, and return the updated company.
Execute delete actions with dapper by running SQL delete statements and passing the id, completing all basic CRUD without entity framework core.
Add an employee model to establish a one-to-many relation with a company, configure EF Core with fluent API and data annotations, and migrate the database to enforce the foreign key.
Create an employee repository by copying the company repository, switch to IEmployeeRepository, implement with dapper, cover add, find, get all, remove, update on employees; register in startup and test CRUD.
Adapt the company controller to an employee controller, register the employee repository in dependency injection, and use bind property for create and edit actions, aligning with Dapper-focused views.
Style the company and employee views with bootstrap in the Dapper getting started course, enabling create, edit, and delete actions, and prepare the app to retrieve companies via Dapper.
Learn to implement employee create, edit, and delete with dapper, populating a company dropdown via a view bag and repository. Use projections to build select list items for the form.
Display the company id for employees within the Dapper getting started course, demonstrate basic CRUD operations, and introduce 1 to 1 mappings while previewing stored procedures.
Implement crud operations for a company using stored procedures via entity framework migrations, including creating, retrieving, updating, and deleting, using migration builder sql and testing in the database.
Leverage dapper with stored procedures by configuring a repository and startup to call USP get all and get company, using command type stored procedure.
Apply dynamic parameters in Dapper to pass multiple fields to the add company stored procedure, execute it, and retrieve the new company ID with scope_identity.
Apply dynamic parameters with dapper to implement update and remove using stored procedures, including passing the company ID, using a USP_update_company, and db.execute, and validate CRUD operations.
Learn how to implement dapper contrib in a .NET project, configure key properties, and replace stored procedures with dapper contrib repository patterns for create, read, update, and delete operations.
Use Dapper Contrib to get all and get a single company. Resolve table name mismatches by adding a table attribute and using full paths to avoid ambiguity, enabling successful retrieval.
Learn to use dapper contrib for crud: insert returns the new id, update uses the entity pattern, and delete supports single or multiple entities.
Expand Dapper knowledge by implementing a bonus repository with a public interface and an IBonusRepository, wire it in startup with add scoped, and set up for more complex scenarios.
Replace company id with company name by populating company data in the employees index. Discuss the N+1 query problem and explore 1-to-1 mapping in Dapper.
Learn how to implement a one-to-one relation in Dapper by joining employees with their company in a single query, mapping two models into an employee with a company.
Explore implementing a one-to-one relation with parameters by filtering employees by optional company id in SQL, using a conditional where clause and parameter passing.
Explore how to retrieve a company with its addresses and all its employees using dapper's query multiple, creating a one-to-many mapping and avoiding the n plus 1 inefficiency.
Learn to display all companies and their employees on the home page using dapper, with a get all company with employees method employing an inner join and a dictionary.
Demonstrates implementing a one-to-many relationship in Dapper by loading companies with their employees using a dictionary, ensuring unique company entries and populated employee lists.
Learn to add dummy records by creating a company with two employees using a bonus repository method, inserting the company and its employees, then redirecting to the index.
Learn to perform bulk deletions in Dapper by implementing a remove range method that deletes multiple company records using an in clause, and filter by name with a like query.
Discover how to perform a bulk insert in dapper by passing a list of employees to db.execute after setting each employee’s company id. Dapper automatically handles the batch insert.
learn to implement atomic transactions in dapper by wrapping company and employees inserts in a transaction scope with try-catch and complete to roll back on error.
Explore asynchronous programming with Dapper, converting sync methods to async variants like query async and add async, using await and task across the repository and controller.
implement a generic dapper repository to execute stored procedures with a reusable template and interface. enable getting all records or a single item via dependency injection.
Dapper provides a super fast library for mapping between databases and .NET. This code-focused course will introduce you to all the basics you need to be productive with Dapper and how to incorporate Dapper in your project.
This is an introductory course on Dapper with ASP.NET Core (.NET 5). This course is for anyone who is new to Dapper for overview with exposure to some advance concepts of Dapper.
When you are finished with this course, you will have the skills and knowledge of Dapper needed to build elegant and high-performance data access layers.