static decimal FindSupplierIncomesForPeriodOfTime(string name, DateTime startDate, DateTime endDate) { using (NorthwindEntities nwDb = new NorthwindEntities()) { var outputParameter = new ObjectParameter("result", typeof(decimal)); nwDb.FindTotalSupplierIncomes(name, startDate, endDate, outputParameter); return(decimal.Parse(outputParameter.Value.ToString())); } }