public static Audit ToDto(this DbAudit audit) { return(new Audit { Id = audit.Id.ToString(), Type = audit.Type, Message = audit.Message, DateCreated = audit.DateCreated }); }
public async Task Add(AuditType type, string message) { var dbAudit = new DbAudit(type, message); SetInitialRecordValues(dbAudit); using (var ctx = GetContext()) { await ctx.AuditLogs.InsertOneAsync(dbAudit); } }