How to get months between two dates in c#?

How to get months between two dates in c#?

 

public static int GetMonthDifference(DateTime startDate, DateTime endDate)
{
    int TotalMonth = 12 * (startDate.Year - endDate.Year) + startDate.Month - endDate.Month;
    return Math.Abs(TotalMonth);
}

2021-10-03