public void OnDelivered(int emailMessageId, Exception error, bool cancelled) { var entity = _entities.Get <EmailMessage>(emailMessageId); entity.LastSendError = error != null ? error.Message : null; entity.CancelledOnUtc = cancelled ? DateTime.UtcNow : (DateTime?)null; if (error == null && !cancelled) { entity.SentOnUtc = DateTime.UtcNow; } _entities.SaveChanges(); }
public void AddGenre(Genre genre) { _writeEntities.Create(genre); _writeEntities.SaveChanges(); }