ToFieldInfo()
Gets a FieldInfo that represents the current field at run time.
Declaration
FieldInfo ToFieldInfo()Returns
| Type | Description |
|---|---|
| FieldInfo | A FieldInfo that can be used only in run-time code. |
Remarks
This method generates run-time code that retrieves the FieldInfo object for the current field. While Metalama is designed to eliminate the need for reflection in most scenarios, this method is useful when you need to pass field metadata to APIs that require FieldInfo objects.
Warning: The code generated by this method relies on field names and may break if your project is obfuscated. Consider using the Value property to access field values directly when possible, as this approach is obfuscation-safe.