添加serilog日志支持和部分其他efcore代码
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Domain.AggregateModel.AppAggregate;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Infrastructure.EntityConfigurations
|
||||
{
|
||||
public class AppEntityTypeConfiguration : IEntityTypeConfiguration<App>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<App> builder)
|
||||
{
|
||||
builder.ToTable("App");
|
||||
builder.HasKey(a => a.Id);
|
||||
builder.Ignore(a => a.DomainEvents);
|
||||
builder.Property(a => a.Id)
|
||||
.ValueGeneratedOnAdd()
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Domain.AggregateModel.LinkAggregate;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Infrastructure.EntityConfigurations
|
||||
{
|
||||
public class LinkEntityTypeConfiguration : IEntityTypeConfiguration<Link>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Link> builder)
|
||||
{
|
||||
builder.ToTable("Link");
|
||||
builder.HasKey(l => l.ShortCode);
|
||||
builder.Ignore(l => l.DomainEvents);
|
||||
builder.Property(l => l.AppId).IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user