C# 8.0 and .net 3.0

82 views Asked by At
using (var db = new Northwind())
            {
                Console.WriteLine("Categories and how many products they have:");
                IQueryable<Category> cats = db.Categories.Include(c => c.Products);
                foreach (Category c in cats)
                {
                    WriteLine($"{c.CategoryName} has {c.Products.Count} products.");
                }
            }

I am reading c # 8.0 .net core 3.0 by Mark J. Price, but I went to Working with Databases Using Entity Framework Core and I got an error during the query. The connection to the database is connected successfully. The error is generated when I output cats (System.ArgumentException: 'Format of the initialization string does not conform to specification starting at index 0.'). I cannot solve this problem, please help me.

0

There are 0 answers