简体   繁体   中英

Generate database or backup from DbContext file in ASP.NET Core Web API

I have a problem. I lost my database in PostgreSQL and I only have a DbContext file that I generated it from my lost database.

If you have an idea about how to get a backup or database from my dbContext file.

Thanks in advance

The EF Core will generate the database according to the DBContext's model. It will just create the new table without any data inside it. That means it couldn't backup or restore your data.

I suggest you could check the PostgreSQL's backups to see if it auto create the backup database and remember backup the database in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM