public static void DoTrack(this NativeActivityContext context, IDbContext dbContext, TrackRecord record) { if (record == null) { return; } var process = Process.GetProcessFromContext(context); record.ProcessId = process.Id; record.Update(dbContext); context.TrackRecord($"TrackRecord written successfully {{Id:{record.Id}}}"); }
protected override void Execute(CodeActivityContext context) { var process = Process.GetProcessFromContext(context); String msg = Message.Get <String>(context); var track = new TrackRecord() { ProcessId = process.Id, Message = msg }; track.Update(process.DbContext); }
void DoTrack(IDbContext dbContext, TrackRecord record, NativeActivityContext context, Int64?userId = null) { if (record == null) { return; } var process = Process.GetProcessFromContext(context.DataContext); record.ProcessId = process.Id; if (record.UserId == 0 && userId.HasValue) { record.UserId = userId.Value; } record.Update(dbContext); TrackRecord(context, $"TrackRecord written successfully {{Id:{record.Id}}}"); }