1
감사 로그를 자동으로 작성하는 방법이 있습니까? 내가 생성 한 다음 DbSet(Of Protocols)
Entity Framework 핵심 감사
내 프로토콜 클래스 : 프로토콜의
Public Class Protocol
Inherits ModelBase
Implements ILogicalTimestamp
<Key>
Public Property ProtocolId As Integer
<Required>
Public Property ProtocolText As String
Public Property CreatedByUserId As Integer?
<Required>
Public Property CreatedByUser As User
<Required>
<DefaultValue(0)>
Public Property Type As ProtocolType
Public Property LinkedToUserId As Integer?
Public Property LinkedToUser As User
Public Property LinkedToBusinessPartnerId As Integer?
Public Property LinkedToBusinessPartner As BusinessPartner
Public Property LinkedToClientId As Integer?
Public Property LinkedToClient As Client
Public Property LinkedToSettingId As Integer?
Public Property LinkedToSetting As Setting
Public Property LastUpdateTimestamp As Date? Implements ILogicalTimestamp.LastUpdateTimestamp
Public Property CreationTimestamp As Date? Implements ILogicalTimestamp.CreationTimestamp
Public Enum ProtocolType
AutoChanges = 0
Explicitly = 1
End Enum
End Class
어떻게 쓸 수의 변화는?
그리고 현재 UserId
을 SaveChanges 메서드로 가져 와서 내 프로토콜 클래스의 CreatedByUserId
속성을 채울 수 있습니까? 누구나 자동으로 그렇게 할 생각이 있습니다.