public IEnumerable <ICallInfo> GetCallInfos(Expression <Func <ICallInfo, bool> > expression) { IEnumerable <ICallInfo> result = null; using (var repository = new CallInfoRepository()) { result = repository.GetEntities(expression) .ToArray() .Select(x => Mapper.Mapper.EntityToDTO(x)) .ToArray(); } return(result); }
public void Add(ICostChangeableCallInfo model) { if (model == null) { throw new ArgumentNullException("model", ""); } this.CalculateCost(model); using (IBillingRepository <ICallInfo> repository = new CallInfoRepository()) { var entity = Mapper.Mapper.DTOtoEntity(model); repository.Add(entity); repository.SaveChanges(); } }