EF Core has several types of DB provider services—one of them is called SqlServerTypeMapper. Sometime there are certain bits of info you may need during development and it’s cool to know quick ways to get the info. For example, you may need to know when you’re using a type in code how it translates in the database. That is, what the equivalent type is. This video shows how to do this with the SqlServerTypeMapper.
- [Instructor] Entity Framework Core…has several types of database provider services.…And one of them is called SQL Server Type Mapper.…Sometimes there are certain bits of information…you may need during development,…and it's cool to know that there's quick ways…to get that information.…For example,…you might want to know when you're using…a certain type in code, what does it translate to,…in the database?…That is, what's the equivalent type?…So for example, if you're using a boolean in code,…how does that translate in the database?…Well I want to show you how to do this,…using the SQL Server Type Mapper.…
So the first thing that we'll want to do is,…in our project, within our Using Statement here,…let's enter in variable sp,…and we'll going to call GetInfrastructure.…And we'll need to bring in the namespace,…I'll hit ctrl period,…to bring in EntityFrameworkCore.Infrastructure.…And within brackets, specify IServiceProvider.…And what we're doing here,…is on the DB Context,…we're calling this extension method called…
- Entity Framework (EF) overview
- Uses for EF
- Installing EF
- Creating entities
- Creating the DbContext
- Performing migrations
- Creating an MVC application
- Installing EF packages
- Reverse engineering the model
- Performing context and dependency injection
- Creating the controller and the view
- Using SqlServerTypeMapper
Skill Level Intermediate
Q: This course was updated on 06/23/2017. What changed?
A: The following topics were updated: using the exercise files; Mac install prerequisites; Entity Framework on Mac, part 1; and Entity Framework on Mac, part 2.