Calculate 8 hours business day in a weekdays only I am fairly new into asp.net MVC c# I am working on request holiday app where an employee can request holidays. The problem is the app works fine, however,  I am trying to set 8 hours a day when an employee requests a holiday I have scratching my head from 2 days already seen every topic in StackOverflow and here and still can't get to work if anyone has any suggestions it will be much appreciated.
Here is a snippet of the calculation of the working days excluding weekends. Thank you in advance.

 public static class DateHelpers
    {
        public static int DaysBetweenExcludingWeekends(DateTime startDate, DateTime endDate)
        {

            var days = 0;
            while (startDate &lt;= endDate)
            {
                if (startDate.DayOfWeek != DayOfWeek.Saturday &amp;&amp; startDate.DayOfWeek != DayOfWeek.Sunday)

                {
                        days++;

                }

                startDate = startDate.AddDays(1);
            }

            return days;
        }

    }
You can throw an error if someone is trying to set a work day to a day that should be a day off. Then you just need to handle this error.