Skip to content

Commit

Permalink
[Remove] redundant Class.QueryAllNonDerivedNonReadOnlyProperties help…
Browse files Browse the repository at this point in the history
…er and improve QueryAllNonDerivedNonReadOnlyProperties implementation
  • Loading branch information
samatstariongroup committed Jan 13, 2025
1 parent 482b650 commit a1acbbe
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions uml4net.HandleBars/ClassHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,14 @@ public static void RegisterClassHelper(this IHandlebars handlebars)
throw new ArgumentException("supposed to be IClass");
}

var properties = @class.QueryAllProperties()
.Where(x => !x.IsDerived || !x.IsDerivedUnion || !x.IsReadOnly)
.OrderBy(x => x.Name);

return properties;
});

handlebars.RegisterHelper("Class.QueryAllNonDerivedNonReadOnlyProperties", (context, _) =>
{
if (!(context.Value is IClass @class))
{
throw new ArgumentException("supposed to be IClass");
}
//var properties = @class.QueryAllProperties()
// .Where(x => !x.IsDerived || !x.IsDerivedUnion || !x.IsReadOnly)
// .OrderBy(x => x.Name);

var properties = @class.QueryAllProperties()
.Where(x => !x.IsDerived || !x.IsDerivedUnion || !x.IsReadOnly)
.Where(x => !x.IsDerived)
.Where(x => !x.IsDerivedUnion)
.Where(x => !x.IsReadOnly)
.OrderBy(x => x.Name);

return properties;
Expand Down

0 comments on commit a1acbbe

Please sign in to comment.