private List<IPaymentType> GetTypes(DbCommand command) { List<IPaymentType> expenseTypes; expenseTypes = new List<IPaymentType>(); foreach (DataRow row in command.GetDataTable().Rows) { expenseTypes.Add(new ExpenseType( Convert.ToInt32(row["Id"]), Convert.ToInt32(row["ExpenseCategoryId"]), row["ExpenseCategoryName"].ToString(), row["Name"].ToString())); } return expenseTypes; }