You can start from this sample https://github.com/Esri/arcgis-enterprise-sdk-resources/blob/master/Samples/dot%20net/SOI/NetLayerAc... . It filters layers of service and you can filter on layer your fields
You could also check out our partner sulution, security.manager, which is an off-the-shelf solution that extends ArcGIS Enterprise, built as an SOI. This will allow you to filter fields from your services exactly as you describe, not to mention layers, objects, spatial restrictions, etc 🙂
Here it is on the Marketplace.