private async Task LogFunction(Guid functionId, Guid userId, CancellationToken cancellationToken) { var logSignUp = new FunctionRun { FunctionId = functionId, UserId = userId, DateTime = DateTime.Now, }; await _passwordWalletContext.AddAsync(logSignUp, cancellationToken); await _passwordWalletContext.SaveChangesAsync(cancellationToken); }
public FunctionRun Add(FunctionRun functionRun) { try { db.FunctionRuns.Add(functionRun); db.SaveChanges(); return(functionRun); } catch (Exception ex) { MessageBox.Show("Exception occured: " + ex.Message, "Adding dataChange to database failed", MessageBoxButton.OK, MessageBoxImage.Warning); } return(null); }