public async Task SetOrgAndAppIdAsync(IDbConnection connection) { var result = await WorkItem.GetOrgAndAppIdAsync(connection, WorkItemId); ApplicationId = result.ApplicationId; OrganizationId = result.OrganizationId; }
public static async Task <int> WriteAsync(IDbConnection connection, EventLog eventLog) { // the app and org might not be readily available in the various model classes that trigger events, // so I provide a little helper for getting those during log write if (eventLog.OrganizationId == 0 || eventLog.ApplicationId == 0) { var orgAndApp = await WorkItem.GetOrgAndAppIdAsync(connection, eventLog.WorkItemId); eventLog.OrganizationId = orgAndApp.OrganizationId; eventLog.ApplicationId = orgAndApp.ApplicationId; } await connection.InsertAsync(eventLog); await Notification.CreateFromEventSubscriptions(connection, eventLog.Id); return(eventLog.Id); }