public async Task SaveAsync(IArmies repository) { var data = new ArmyRepositoryDto { Squads = new List <SquadRepositoryDto>() }; data.OwnerLogin = OwnerLogin; squads.ForEach(squad => squad.FillArmyData(data)); await repository.SaveAsync(data); }
public CommandsFactory(IArmyFactory armyFactory, IArmies armyRepository, IUsers usersRepository, IGetCurrentUserLoginStrategy currentUserLogin, IArmyNotificationService armyNotificationsService, ILog logger) { this.armyFactory = armyFactory; this.armyRepository = armyRepository; this.usersRepository = usersRepository; this.currentUserLogin = currentUserLogin; this.armyNotificationsService = armyNotificationsService; this.logger = logger; }
public CreateArmyCommand(IArmyFactory armyFactory, IArmies armyRepository, IGetCurrentUserLoginStrategy currentUserLogin, IArmyNotificationService armyNotificationsService, ILog logger, ArmyPostDto data) { this.armyFactory = armyFactory; this.armyRepository = armyRepository; this.currentUserLogin = currentUserLogin; this.armyNotificationsService = armyNotificationsService; this.logger = logger; this.data = data; }