0
I need to build two methods in my system, which do the following:
1) Save to a dictionary<T>
in C#, a crease of dates. For this I have a function that consumption in the Sqlserver here from the company, who returns me a whole working day. The standard architecture is already established this way, so I have to do it this way;
The Function of Sqlserver, I consume as follows:
using (IDbConnection dbConnection = Connection)
{
string sQuery = "select dbo.working_days(@dtUtil) as QuantidadeDiasUteis";
dbConnection.Open();
return dbConnection.Query<DiasUteis>(sQuery, new { dtUtil =
Convert.ToDateTime(DtDiaUtil) }).FirstOrDefault();
}
Note: My input parameter is a future date, and it returns me the number of working days in an integer.
2) After the dates in the Dictionary
, I need to read, check the dates.
So the structure would look something like this:
31/07/2018 = 1;
01/08/2018 = 3;
06/08/2018 = 4; ==> (Ignorou os Sábados e Domingos);
I need to return this information!
It has to be a
Dictionary
? since it will store only dates can not be aList<DateTime>
?– Barbetta