partial void HandleImplementation(CreateElection message)
 {
     // Implement your handler logic here.
     Console.WriteLine("Elections received " + message.GetType().Name);
     //throw new Exception("Something went wrong!");
     Bus.Publish<ElectionCreated>();
 }
Ejemplo n.º 2
0
 partial void HandleImplementation(CreateElection message)
 {
     // Implement your handler logic here.
     Console.WriteLine("Elections received " + message.GetType().Name);
     //throw new Exception("Something went wrong!");
     Bus.Publish <ElectionCreated>();
 }
Ejemplo n.º 3
0
        public async Task <Election> CreateElectionAsync(CreateElection model)
        {
            Election election = _mapper.Map <Election>(model);

            ValidateElectionCandidate(election.Candidates);

            election.Address = EthECKey.GenerateKey().GetPublicAddress();

            _commonDbContext.Elections.Add(election);

            await _commonDbContext.SaveChangesAsync();

            return(election);
        }
Ejemplo n.º 4
0
 public void Send(CreateElection message)
 {
     Bus.Send(message);
 }
Ejemplo n.º 5
0
        public async Task <IActionResult> CreateElection(CreateElection election)
        {
            await _electionService.CreateElectionAsync(election);

            return(Ok());
        }
        public void Send(CreateElection message)
		{
			Bus.Send(message);	
		}