Skip to content

Instantly share code, notes, and snippets.

@horsdal
Created January 13, 2018 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horsdal/985e8b0bcb17772a9cd4c991156cf9e3 to your computer and use it in GitHub Desktop.
Save horsdal/985e8b0bcb17772a9cd4c991156cf9e3 to your computer and use it in GitHub Desktop.
public class UsernameChangedEvent : Event<UserAggregate>
{
public string Username { get; }
public Guid Id { get; }
public string OldUsername { get; }
public UsernameChangedEvent(string username, Guid id, string oldUsername)
{
this.Username = username;
this.Id = id;
this.OldUsername = oldUsername;
}
public void When(UserAggregate aggregate)
{
aggregate.Username = this.Username;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment