有人能告诉我下面方括号的功能是什么?或者他们叫什么,我可以google关于它.我不知道放在搜索框中的内容…
type [Entity] [Automapping] TPerson = class private FId: integer; FLastName: string; FFirstName: string; FEmail: string; public property Id: integer read FId; property LastName: string read FLastName write FLastName; property FirstName: string read FFirstName write FFirstName; property Email: string read FEmail write FEmail; end;
解决方法
那些是装饰班的
attributes.
Attributes are a language feature in Delphi that allows annotating types and type members with special objects that carry additional information. This information can be queried at run time. Attributes extend the normal Object-Oriented model with Aspect-Oriented elements.
In general,attributes are useful when building general purpose frameworks that analyze structured types such as objects or records at run time and introduce new behavior based on additional information supplied by the annotated attributes.
这是一个相当于其他语言注释的功能.