I'm wanting to call this stored procedure with input parameters:
proc [dbo].[Invoice_GetHomePageInvoices] (
@FinancialYearStartDate datetime = null
, @FinancialYearEndDate datetime = null
Trouble with this is the way I usually call a stored proc from my code is:
return _db.Database.SqlQuery<HomePageInvoice>(string.Format("EXEC Invoice_GetHomePageInvoices @FinancialYearStartDate = '{0}', @FinancialYearEndDate = '{1}'", financialYear.StartDate.ToString(), financialYear.EndDate.ToString()));
So this isn't going to work because I've basically converted my datetimes to strings.
How the heck am I supposed to do this?