添加管理员控制器,api控制器功能
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Apimanager_backend.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Apimanager_backend.Data
|
||||
{
|
||||
public class ApiRequestExampleConfig : IEntityTypeConfiguration<ApiRequestExample>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ApiRequestExample> builder)
|
||||
{
|
||||
//主键
|
||||
builder.HasKey(x => x.Id);
|
||||
//外键
|
||||
builder.HasOne(x => x.Api)
|
||||
.WithMany(u => u.ApiRequestExamples)
|
||||
.HasForeignKey(x => x.ApiId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user