In other words, find a place to put the code, put it in an appropriate namespace, add the necessary using statements, and call it like you would call any other method.
@RobertHarvey You understood not quite right. I want that if the database was absent when creating the context, then Database.EnsureCreated (); it was created + executed by some SQL code. Can I override any DbContext method to achieve the goal?
usingstatements, and call it like you would call any other method.