Abstract
Generated code will always be code that was not known at compile time. The whole point of generating code is to make it easier to change the business rules after deployment. This is where reflection comes in. Reflection allows you to access metadata about your code at runtime. With it, you can load an assembly, discover the types in the assembly, create an instance of these types, and systematically execute any method discovered in these types. This is exactly what you need to evaluate new business logic.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Nick Harrison
About this chapter
Cite this chapter
Harrison, N. (2017). Reflecting on Generated Code. In: Code Generation with Roslyn. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2211-9_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2211-9_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2210-2
Online ISBN: 978-1-4842-2211-9
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)