Skip to content

New Feature: Callbacks

Latest
Compare
Choose a tag to compare
@DyegoMaas DyegoMaas released this 25 Feb 19:30
· 8 commits to main since this release

Callbacks

Now it is possible to define a callback with the new Do() method. It works essencially just like the With() method, but with a different signature.

var project = MagicFactory.For<Project>()
    .With(x => x.ProjectName = "Apollo")
    .Do(x => Console.WriteLine(x.ProjectName) // prints "Apollo"
    .Build();