public async Task WriteAsync(ScGimpNotification logEntry) { using (ScGimpContext db = new ScGimpContext()) { // Add new notification await db.Notifications.AddAsync ( new Notification() { Body = logEntry.Body.Left(4000), CreatedAt = DateTimeOffset.Now, Items = logEntry.Items.Left(4000), NotificationId = 0, NotificationType = logEntry.NotificationType.Left(50), Recipients = logEntry.Recipients.Left(4000), Medium = logEntry.Medium.Left(50) } ); await db.SaveChangesAsync(); } }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously /// <summary> /// /// </summary> /// <param name="logEntry"></param> /// <returns></returns> public async Task WriteAsync(ScGimpNotification logEntry) #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { }