diff --git a/WebApi_data_value/Controllers/Violation_car_tableController.cs b/WebApi_data_value/Controllers/Violation_car_tableController.cs
index 113c0f2..964f1e4 100644
--- a/WebApi_data_value/Controllers/Violation_car_tableController.cs
+++ b/WebApi_data_value/Controllers/Violation_car_tableController.cs
@@ -179,6 +179,31 @@ namespace WebApi_data_value.Controllers
}
#endregion
+ #region
+ ///
+ /// 尋找違規次數最多
+ ///
+ ///
+ [HttpGet("recidivists")]
+ public async Task> GetRecidivists()
+ {
+
+ var plateNumberOccurrences = await _context.violation_car_table
+ .GroupBy(c => c.license_plate_number)
+ .Select(group => new
+ {
+ LicensePlateNumber = group.Key,
+ Occurrences = group.Count()
+ })
+ .OrderByDescending(x => x.Occurrences)
+ .ToListAsync();
+
+
+ return plateNumberOccurrences;
+ }
+ #endregion
+
+
#region 新增違規車輛
///
/// 新增違規車輛