var assembly = typeof(Department).Assembly; services.AddControllers().AddControllersAsServices() .PartManager.ApplicationParts.Add(new AssemblyPart(assembly));