public static FieldDefinition CreateReadonlyField <T>(this ModuleDefinition moduleDefinition, string name, bool @public) { if (moduleDefinition == null) { throw new ArgumentNullException(nameof(moduleDefinition)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } return(moduleDefinition.CreateReadonlyField(name, @public, moduleDefinition.Get <T>())); }