public async Task <ActionResult> RemoveClaim(string client, string type, string value) { var model = new RemoveClientClaimViewModel(client, type, value); await _clientAppService.RemoveClaim(model); return(ResponseDelete()); }
public async Task <ActionResult> RemoveClaim(string client, int claimId) { var model = new RemoveClientClaimViewModel(client, claimId); await _clientAppService.RemoveClaim(model); return(ResponseDelete()); }
public async Task <ActionResult <DefaultResponse <bool> > > RemoveClaim([FromBody] RemoveClientClaimViewModel model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(false)); } await _clientAppService.RemoveClaim(model); return(Response(true)); }
public async Task Should_Remove_ClientClaim() { var command = ClientViewModelFaker.GenerateSaveClient().Generate(); await _clientAppService.Save(command); var property = ClientViewModelFaker.GenerateSaveClaim(command.ClientId).Generate(); await _clientAppService.SaveClaim(property); _database.Clients.FirstOrDefault(s => s.ClientId == command.ClientId).Should().NotBeNull(); var clams = _database.ClientClaims.Include(i => i.Client).Where(f => f.Client.ClientId == command.ClientId); clams.Should().HaveCountGreaterOrEqualTo(1); var removeClaim = new RemoveClientClaimViewModel(command.ClientId, property.Type, property.Value); await _clientAppService.RemoveClaim(removeClaim); var clientDb = await _database.Clients.Include(s => s.Claims).FirstOrDefaultAsync(s => s.ClientId == command.ClientId); clientDb.Claims.Should().BeEmpty(); }
public Task <bool> RemoveClaim(RemoveClientClaimViewModel model) { var registerCommand = _mapper.Map <RemoveClientClaimCommand>(model); return(Bus.SendCommand(registerCommand)); }
public Task RemoveClaim(RemoveClientClaimViewModel model) { throw new System.NotImplementedException(); }