Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Access Database created with DBContext

recently i started to learn C# and ASP.NET Core for a new job, as part of the practice i created a small api for CRUD operation that includes a database, i have created the DB using the entity framework core. I wanted to figure out how does this DB created and all of the tables in it because in the code i did not mention any tables name or something.. ? and one more thing is can i access this DB using SSMS or some other GUI to actually see the data ? Note: I am using Visual Studio 2019

namespace TodoApi.Models
{
    public class TodoContext : DbContext
    {
        public TodoContext(DbContextOptions<TodoContext> options)
            : base(options)
        {}

        public DbSet<TodoItem> TodoItems { get; set; }
    }
}

Startup.cs:

 services.AddDbContext<TodoContext>(opt =>
       opt.UseInMemoryDatabase("TodoList"));

Thank you in advance !

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

So, you're using an in-memory database. This means that's it's ultimately all stored in memory in the application. That means there will be no files on disk, and no way to access it remotely using a tool like SSMS. That's also why you don't need to specify a table name etc., because it's not needed for an in-memory database because it's kind of just a fancy way of storing all the data in an array, as a simple analogy. The in-memory provider's primary usage is for testing.

If you want to be able to view the contents of the database in a tool such as SSMS, you'll need to use the SQL Server provider (which will require a connection string etc.), which would be configured with opt.UseSqlServer(...). Alternatively if you didn't want to use SQL Server, you could use the SQLite provider.

Documentation about the different providers available can be found here.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!