Skip to content

Commit 6ba83fb

Browse files
committed
Added aspects ordering before actual execution
1 parent 2c4edbf commit 6ba83fb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

SharpRepository.Repository/RepositoryBase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,12 +1304,17 @@ private bool RunAspect(Func<RepositoryActionBaseAttribute, bool> action)
13041304
{
13051305
return _aspects.Values
13061306
.Where(a => a.Enabled)
1307+
.OrderBy(a => a.Order)
13071308
.All(action);
13081309
}
13091310

13101311
private void RunAspect(Action<RepositoryActionBaseAttribute> action)
13111312
{
1312-
foreach (var attribute in _aspects.Values.Where(a => a.Enabled))
1313+
var aspects = _aspects.Values
1314+
.Where(a => a.Enabled)
1315+
.OrderBy(a => a.Order);
1316+
1317+
foreach (var attribute in aspects)
13131318
{
13141319
action(attribute);
13151320
}

0 commit comments

Comments
 (0)