MicrosoftDocs / ef-core-for-beginners

Project for Entity Framework Core for Beginners video series
Creative Commons Attribution 4.0 International
83 stars 55 forks source link

Code Tour 1 / Step 40 - Insert Code selection points are wrong #5

Closed jongalloway closed 2 years ago

jongalloway commented 2 years ago

When I insert the code on Step 40, it overwrites the using statements rather than the data operation. I think it's supposed to replace this:

var veggieSpecial = context.Products
                       .Where(p => p.Name == "Veggie Special Pizza")
                       .FirstOrDefault();

if (veggieSpecial is Product)
{
    context.Remove(veggieSpecial);
}

I think these are the values that need to be updated: https://github.com/MicrosoftDocs/ef-core-for-beginners/blob/e3a2896253f8f589622f2fd47233cb668647d64b/.tours/1-getting-started.tour#L441

image