﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DNK.Bonuses.Data
{
    public class ChangeRow
    {
        private IList<object> _inserts;
        private IList<object> _updates;
        private IList<object> _deletes;

        public ChangeRow(DataContext db)
        {
            ChangeSet changes = db.GetChangeSet();
            _inserts = changes.Inserts;
            _updates = changes.Updates;
            _deletes = changes.Deletes;
        }

        public IList<object> Inserts
        {
            get
            {
                return _inserts;
            }
        }

        public int InsertCount
        {
            get { return _inserts == null ? 0 : _inserts.Count; }
        }

        public IList<object> Updates
        {
            get { return _updates; }

        }

        public int UpdateCount
        {
            get { return _updates == null ? 0 : _updates.Count; }
        }

        public IList<object> Deletes
        {
            get { return _deletes; }
        }

        public int DeleteCount
        {
            get { return _deletes == null ? 0 : _deletes.Count; }
        }
    }
}
