Is it possible to write to the database once an Entity has been created? Since the connection has been closed _repository.insert(...) will not save any changes, and initiating a new DB connection throws me a "The current TransactionScope is already complete" error.
Am I missing something obvious?
Code below:
private readonly IRepository<ActivityLog> _activityLogRepository;
public ActivityLogWriter(IRepository<ActivityLog> activityLogRepository)
{
_activityLogRepository = activityLogRepository;
}
public void HandleEvent(EntityCreatedEventData<Comment> eventData)
{
_activityLogRepository.Insert(new ActivityLog
{
Message = "Something about the inserted entity"
});
}