track/src/TrackCenter.Repository/TrackCenterDbContext.cs
xiaolipro d21149a973
All checks were successful
Build and Deploy / deploy (push) Successful in 52s
..
2026-09-28 09:40:00 +08:00

29 lines
719 B
C#

using System.Reflection;
using Fake;
using Fake.Domain.Entities;
using Fake.SqlSugarCore;
namespace TrackCenter.Repository;
public class TrackCenterDbContext : SugarDbContext<TrackCenterDbContext>
{
public TrackCenterDbContext(SugarDbConnOptions<TrackCenterDbContext> options) : base(options)
{
}
protected override void ConfigureEntityService(PropertyInfo property, EntityColumnInfo column)
{
if (property.Name == nameof(IAggregateRoot.ConcurrencyStamp))
{
column.IsIgnore = true;
}
base.ConfigureEntityService(property, column);
if (property.Name == nameof(Entity<Any>.Id))
{
column.IsIdentity = true;
}
}
}