public void LinkToOrganisation(Organisation organisation) { Guard.ArgumentNotNull(() => organisation, organisation); if (Organisation != null) { throw new InvalidOperationException( string.Format( "User {0} is already linked to an organisation and may not be linked to another. This user is linked to organisation: {1}", Id, Organisation.Id)); } Organisation = organisation; }
public void UpdateOrganisationOfUser(Organisation organisation) { Guard.ArgumentNotNull(() => organisation, organisation); Organisation = organisation; }