Пример #1
0
 protected override void Hook(ICreationTracking entity, HookEntityMetadata metadata, IUnitOfWork uow)
 {
     metadata.Entry.Property(EFCore.CreationDateTime).CurrentValue   = _dateTime.UtcNow;
     metadata.Entry.Property(EFCore.CreatorBrowserName).CurrentValue = _session.UserBrowserName;
     metadata.Entry.Property(EFCore.CreatorIp).CurrentValue          = _session.UserIP;
     metadata.Entry.Property(EFCore.CreatorUserId).CurrentValue      = _session.UserId.FromString <TUserId>();
 }
 protected override void Hook(ICreationTracking entity, HookEntityMetadata metadata, IDbContext dbContext)
 {
     metadata.Entry.Property(EFCoreShadow.CreatedDateTime).CurrentValue      = _clock.Now;
     metadata.Entry.Property(EFCoreShadow.CreatedByBrowserName).CurrentValue = _session.UserBrowserName;
     metadata.Entry.Property(EFCoreShadow.CreatedByIP).CurrentValue          = _session.UserIP;
     metadata.Entry.Property(EFCoreShadow.CreatedByUserId).CurrentValue      = _session.UserId.To <TUserId>();
 }
Пример #3
0
        static void TrackInsert(ICreationTracking track)
        {
            if (track == null)
            {
                return;
            }

            track.CreatedOn = DateTime.Now;
            track.CreatedBy = GetUserID();

            TrackUpdate(track as IChangeTracking);
        }