Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "daniel"

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"
			});
		}
Showing 11 to 11 of 11 entries