public IEnumerable <IBillingPlan> GetBillingPlans() { IEnumerable <IBillingPlan> result = null; using (var repository = new BillingPlanRepository()) { result = repository.GetEntities().ToArray().Select(x => Mapper.Mapper.EntityToDTO(x)).ToArray(); } return(result); }
public void Add(IBillingPlan newPlan) { Model.BillingPlan model = new Model.BillingPlan() { Id = newPlan.Id, Calculator = newPlan }; using (IBillingRepository <IBillingPlan> repository = new BillingPlanRepository()) { repository.Add(model); repository.SaveChanges(); } }
public IEnumerable <IBillingPlan> GetBillingPlans(Expression <Func <IBillingPlan, bool> > expression) { //ParameterExpression sourceParameter = expression.Parameters.FirstOrDefault(x => x.Type == typeof(IBillingPlan)); //var newExpression = Billing.BL.ExpressionTransformationSupport // .ParameterTypeTransformer<IBillingPlan, Model.BillingPlan> // .TransformPredicate(expression, sourceParameter); IEnumerable <IBillingPlan> result = null; using (var repository = new BillingPlanRepository()) { result = repository.GetEntities(expression).ToArray().Select(x => Mapper.Mapper.EntityToDTO(x)).ToArray(); } return(result); }