Example #1
0
        static void Main(string[] args)
        {
            using (var db = new BloggingContext())
            {
                // TODO Get ServiceProvider and resolve type mapper from it

                Console.WriteLine($"Type mapper in use: ");
                Console.WriteLine($"Mapping for bool: ");
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            using (var db = new BloggingContext())
            {
                var serviceProvider = db.GetInfrastructure<IServiceProvider>();
                var typeMapper = serviceProvider.GetService<IRelationalTypeMapper>();

                Console.WriteLine($"Type mapper in use: {typeMapper.GetType().Name}");
                Console.WriteLine($"Mapping for bool: {typeMapper.GetMapping(typeof(bool)).StoreType}");
                Console.WriteLine($"Mapping for string: {typeMapper.GetMapping(typeof(string)).StoreType}");
            }
        }