public IEnumerable <ExpenseCategoryViewModel> GetExpenseCategories() { var source = _expenseCategoryRepository.Query(i => i.IsActive == Constants.ACTIVE); var destination = Mapper.Map <IEnumerable <ExpenseCategory_M>, IEnumerable <ExpenseCategoryViewModel> >(source); return(destination); }
public ExpenseCategoryViewModel GetFuelExpenseByName(string name) { var cateExpense = _expenseCategoryRepository.Query(p => p.CategoryN.Equals(name)).FirstOrDefault(); if (cateExpense != null) { var mCategories = Mapper.Map <ExpenseCategory_M, ExpenseCategoryViewModel>(cateExpense); return(mCategories); } return(null); }