02
Sep
Introduction Learn how to return unmapped types using SqlQuery which may be useful when mapped types are not sufficient. There are several overloads for SqlQuery, here we will use the following along with SqlQueryRaw which is not recommended as unlike SqlQery will leave parameters exposed to hackers. SqlQuery Create the SQL statement, in this case the SQL is to get all United States holidays in a given year. public static FormattableString GetHolidays(int year) => $""" SELECT CalendarDate, CalendarDateDescription AS [Description], CalendarMonth, DATENAME(MONTH, DATEADD(MONTH, CalendarMonth, -1)) AS [Month], CalendarDay AS [Day], DayOfWeekName, IIF(BusinessDay = 0, 'No', 'Yes') AS BusinessDay, IIF(Weekday =…