public async Task Should_Remove_Item_If_It_Exists()
        {
            //Arrange
            const int id          = 100;
            var       participant = new Participant
            {
                Name       = "Test",
                SecondName = "Test",
                Id         = id
            };
            await _repository.AddParticipant(participant);

            //Act
            await _service.RemoveParticipant(id);

            //Assert
            Assert.IsFalse(await _repository.IsExist(id));
        }
        public Participant RealizeParticipant(Participant unreal, IParticipantRepository participantRepository)
        {
            if (participantRepository.GetParticipants(partitionKey).Any(p => p.Email == unreal.Email))
            {
                throw new System.InvalidOperationException(emailExists);
            }

            unreal.RowKey       = Guid.NewGuid().ToString();
            unreal.PartitionKey = partitionKey;
            unreal.Registered   = DateTime.UtcNow;

            participantRepository.AddParticipant(unreal);

            return(unreal);
        }
Beispiel #3
0
 public async Task <Participant> AddParticipant(Participant participant)
 {
     return(await _repository.AddParticipant(participant));
 }
 public IActionResult AddParticipant([FromBody] ConferenceAudienceModel obj)
 {
     _participantRepository.AddParticipant(obj);
     return(Ok());
 }