Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda