public static CustomerSourceOfIncome Create(SourceOfIncome sourceOfIncome, Customer customer, DateTime today)
        {
            CustomerSourceOfIncome customerSourceOfIncome = new CustomerSourceOfIncome();
            customerSourceOfIncome.Customer = customer;
            customerSourceOfIncome.EffectiveDate = today;
            customerSourceOfIncome.SourceOfIncome = sourceOfIncome;

            Context.CustomerSourceOfIncomes.AddObject(customerSourceOfIncome);
            return customerSourceOfIncome;
        }
        public static CustomerSourceOfIncome CreateOrUpdate(SourceOfIncome sourceOfIncome, Customer customer, DateTime today)
        {
            CustomerSourceOfIncome current = GetActive(customer, sourceOfIncome);
            if (current != null)
                current.EndDate = today;

            CustomerSourceOfIncome customerSourceOfIncome = new CustomerSourceOfIncome();
            customerSourceOfIncome.Customer = customer;
            customerSourceOfIncome.EffectiveDate = today;
            customerSourceOfIncome.SourceOfIncome = sourceOfIncome;

            Context.CustomerSourceOfIncomes.AddObject(customerSourceOfIncome);
            return customerSourceOfIncome;
        }
 public static IQueryable<SourceOfIncome> All(CustomerSourceOfIncome sourceOfIncome)
 {
     return Context.SourceOfIncomes.Where(entity => entity.Id == sourceOfIncome.SourceOfIncomeId);
 }