As shown in the image below, I need to fetch query mentioned within query section of a layer using ArcObjects in C#.
IDocument doc = ArcMap.Application.Document;
IMxDocument mxDoc = doc as IMxDocument;
IMap map = mxDoc.FocusMap;
ILayer mapLayer = map.get_Layer(0);
IFeatureClass c = (mapLayer as IFeatureLayer).FeatureClass;