public static EmployeeSummaryViewModel FromData(EmployeeDetail data)
        {
            if (data == null)
                return null;

            return new EmployeeSummaryViewModel()
            {
                 Id = data.Id,
                 Name = data.Name
            };
        }
        /// <summary>
        /// Maps an domain side employee model to a read side one.
        /// </summary>
        /// <param name="value">read side instance</param>
        /// <param name="existing">existing version to map to</param>
        /// <returns>read side model</returns>
        public static EmployeeDetail ToEmployeeDetail(this EmployeeModel value, EmployeeDetail existing = null)
        {
            existing = existing ?? new EmployeeDetail();
            existing.Id = value.Id;
            existing.Name = value.Name;
            existing.Benefits = value.Benefits;
            existing.Dependents = (byte)value.Dependents.Length;
            existing.GrossPay = value.GrossPay;
            existing.IsDeleted = value.IsDeleted;
            existing.NetPay = value.NetPay;
            existing.Version = value.Version;

            return existing;
        }
        public static EmployeeDetailViewModel FromQueryModel(EmployeeDetail value)
        {
            if (value == null)
                return null;

            return new EmployeeDetailViewModel()
            {
                Id = value.Id,
                Name = value.Name,
                Version = value.Version,
                GrossPay = value.GrossPay,
                Benefits = value.Benefits,
                NetPay = value.NetPay,
                Dependents = value.DependentDetails.Select(i => DependentViewModel.FromQueryModel(i))
            };
        }
        /// <summary>
        /// Creates a mock of the IQueries interface.
        /// </summary>
        /// <returns>Configured mock</returns>
        static IQueries CreateIQueriesMock()
        {
            var employee1 = new EmployeeDetail()
            {
                Benefits = 38M,
                GrossPay = 2000M,
                Id = "1",
                IsDeleted = false,
                Name = "ThisGuy",
                NetPay = 1962M,
                Version = 1,
                Dependents = 0
            };

            var employee2 = new EmployeeDetail()
            {
                Benefits = 57M,
                GrossPay = 2000M,
                Id = "2",
                IsDeleted = false,
                Name = "ThisGuy",
                NetPay = 1943M,
                Version = 1,
                Dependents = 1
            };

            employee2.DependentDetails.Add(new DependentDetail() { EmployeeDetail = employee2, EmployeeId = "2", Id = "1", Name = "OtherGuy" });

            var employees = new List<EmployeeDetail>()
            {
                 employee1,
                 employee2
            };

            var mock = new Mock<IQueries>();

            mock.Setup(i => i.GetAllEmployees()).Returns(employees);
            mock.Setup(i => i.GetEmployeeById("1")).Returns(employee1);
            mock.Setup(i => i.GetEmployeeById("2")).Returns(employee2);

            return mock.Object;
        }