v9.6.2017.0808   重构正向工程,基于映射表查找数据库字段类型到实体类型的映射
大石头 authored at 2017-08-08 21:38:06
980.00 B
X
using System;
using System.Collections.Generic;

namespace NewLife.Queue.Broker
{
    public class BatchMessageLogRecord
    {
        private readonly IEnumerable<MessageLogRecord> _records;
        private readonly Action<BatchMessageLogRecord, object> _callback;
        private readonly object _parameter;

        public IEnumerable<MessageLogRecord> Records
        {
            get { return _records; }
        }
        public Action<BatchMessageLogRecord, object> Callback
        {
            get { return _callback; }
        }

        public BatchMessageLogRecord(IEnumerable<MessageLogRecord> records, Action<BatchMessageLogRecord, object> callback, object parameter)
        {
            _records = records;
            _callback = callback;
            _parameter = parameter;
        }

        public void OnPersisted()
        {
            if (_callback != null)
            {
                _callback(this, _parameter);
            }
        }
    }
}