should be fine depending on the context, i.e. if you're in a controller. you can also inject the IHttpContextAccessor through DI if you want an alternative
have you created the table in your actual sqlite instance? EF Core knowing the table exists in your model doesn't mean it exists in the physical database