MacroAttribute Class
Allows specifying a macro for a parameter of a source template.
Namespace:
RingSoft.DbMaintenanceAssembly: RingSoft.DbMaintenance (in RingSoft.DbMaintenance.dll)
Syntax
[AttributeUsageAttribute] public sealed class MacroAttribute : Attribute
<AttributeUsageAttribute> _ Public NotInheritable Class MacroAttribute _ Inherits Attribute
[AttributeUsageAttribute] public ref class MacroAttribute sealed : public Attribute
Remarks
Examples
C#
[SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] public static void forEach<T>(this IEnumerable<T> collection) { foreach (var item in collection) { //$ $END$ } }
C#
[SourceTemplate] public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) { /*$ var $x$Id = "$newguid$" + x.ToString(); x.DoSomething($x$Id); */ }