public UserCanOnlyHaveOneCharacter( ISingleCharacterPerUserChecker singleCharacterPerUserChecker, Guid userId) { _singleCharacterPerUserChecker = singleCharacterPerUserChecker; _userId = userId; }
public CreateCharacterCommandHandler( ICharacterRepository characterRepository, ISingleCharacterPerUserChecker singleCharacterPerUserChecker, IUnitOfWork unitOfWork) { _characterRepository = characterRepository; _singleCharacterPerUserChecker = singleCharacterPerUserChecker; _unitOfWork = unitOfWork; }
public static Character Create( Guid userId, string firstName, string lastName, SexType sex, ISingleCharacterPerUserChecker singleCharacterPerUserChecker) { CheckRule(new UserCanOnlyHaveOneCharacter(singleCharacterPerUserChecker, userId)); return(new Character(userId, firstName, lastName, sex)); }