You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, Moxy will only re-generate source for a mix-in decorated class if
The class's signature changes
The contents of the .mixin file changes
Adding/removing members does inside a C# class does not trigger a regeneration of its mix-ins, this is to enhance performance.
I want to be able to provide additional information to a mix-in about the class that it is working on. For example, it would be nice to be able to see the names of the class's properties, or only properties that are decorated with [Required] - but I don't want to start triggering source regeneration every time the coder alters their code on a property / method / field if there are no mix-ins that care.
So, I'm considering supporting some kind of query definition in the header of a .mixin
@moxy
@reflect someData = ( want the names of all properties decorated with MinLength, and the Length value of that attribute)
@moxy
{{ for datum in someData }}
Property {{ datum.Name }} has a min length of {{ datum.Length }}
{{ end }}
This will allow me to convert the reflect selection to json which gives two benefits
The values can be made available inside the Scriban template
I will only need to regenerate the source code for the mix-in whenever the json changes
RFC
I'd like suggestions for what the query text format might look like.
Any ideas appreciated!
The text was updated successfully, but these errors were encountered:
properties = public instance properties
non-public properties = instance properties that are not public
public static methods = methods that are static and public
At the moment, Moxy will only re-generate source for a mix-in decorated class if
.mixin
file changesAdding/removing members does inside a C# class does not trigger a regeneration of its mix-ins, this is to enhance performance.
I want to be able to provide additional information to a mix-in about the class that it is working on. For example, it would be nice to be able to see the names of the class's properties, or only properties that are decorated with
[Required]
- but I don't want to start triggering source regeneration every time the coder alters their code on a property / method / field if there are no mix-ins that care.So, I'm considering supporting some kind of query definition in the header of a
.mixin
{{ for datum in someData }}
Property {{ datum.Name }} has a min length of {{ datum.Length }}
{{ end }}
This will allow me to convert the
reflect
selection to json which gives two benefitsRFC
I'd like suggestions for what the query text format might look like.
Any ideas appreciated!
The text was updated successfully, but these errors were encountered: