让我解释一下:我有一个连接到 postgres 数据库的 .net core 3.0 API。我想用这个 API 执行基本的 CRUD 操作。我使用 swagger 来显示 webrequest。一旦我创建了我的上下文,我就会迁移到运行良好的数据库,但是一旦我想与我创建的表进行交互,就会出现以下错误:
![NpgsqlException : 连接时出现异常] 2
与数据库的连接:
我的控制器:
[Route("api/[controller]")]
[ApiController]
public class CatalogueController : ControllerBase
{
private readonly CatalogueContext _context;
public CatalogueController(CatalogueContext context)
{
_context = context;
}
[HttpGet]
public ActionResult<IEnumerable<Article>> GetCatalogue()
{
return _context.Article.ToList();
}
}
Run Code Online (Sandbox Code Playgroud)
我的背景:
public class CatalogueContext : DbContext
{
public CatalogueContext(DbContextOptions<CatalogueContext> options) : base(options)
{
}
public DbSet<Article> Article { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我的数据库上的表格文章(我使用 DBeaver):
api postgresql entity-framework docker-compose asp.net-core-3.0
我无法增加容器的最大宽度。如何更改源代码中的宽度?
我已经尝试在 bootstrap-grid.css 页面中更改宽度的大小。
元素检查器允许我更改最大宽度。如何修改_grid.scss: 6 文件?
@media (min-width: 1200px) {
.container {
max-width: 1140px;
}
}
Run Code Online (Sandbox Code Playgroud)