SPFeatureDefinition.SolutionId Property
Gets the identifier of the solution used to deploy this Feature, or Empty if the Feature was added directly through a command-line operation or through the object model.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online