public PeanutParticipationType Create(PeanutParticipationTypeDto participationTypeDto, UserGroup userGroup, User createdBy) { PeanutParticipationType peanutParticipationType = new PeanutParticipationType(participationTypeDto, userGroup, new EntityCreatedDto(createdBy, DateTime.Now)); PeanutParticipationTypeDao.Save(peanutParticipationType); return(peanutParticipationType); }
public PeanutParticipationType Create(UserGroup userGroup = null, string name = "Test Typ", bool isCreditor = true, bool isProducer = false, int maxParticipators = 1, bool persist = true) { if (userGroup == null) { userGroup = UserGroupCreator.Create(); } User user = UserGroupMembershipCreator.Create(userGroup, persist: persist).User; var peanutParticipationTypeDto = new PeanutParticipationTypeDto { IsCreditor = isCreditor, Name = name, IsProducer = isProducer, MaxParticipatorsOfType = maxParticipators }; PeanutParticipationType peanutParticipationType = new PeanutParticipationType(peanutParticipationTypeDto, userGroup, new EntityCreatedDto(user, DateTime.Now)); return(peanutParticipationType); }