public async Task <ActionResult> Update(string resource, [FromBody] IdentityResource model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(ModelStateErrorResponseError()); } await _identityResourceAppService.Update(resource, model); return(ResponsePutPatch()); }
public async Task <ActionResult <DefaultResponse <bool> > > Update([FromBody] IdentityResourceViewModel model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(false)); } await _identityResourceAppService.Update(model); return(Response(true)); }
public async Task ShouldUpdateIdentityResource() { var command = IdentityResourceFaker.GenerateIdentiyResource().Generate(); await _identityResource.Save(command); var client = _database.IdentityResources.FirstOrDefault(s => s.Name == command.Name); client.Should().NotBeNull(); InMemoryData.DetachAll(); var updateCommand = IdentityResourceFaker.GenerateIdentiyResource().Generate(); await _identityResource.Update(command.Name, updateCommand); _database.IdentityResources.FirstOrDefault(f => f.Name == updateCommand.Name).Should().NotBeNull(); }
public async Task Should_Update_IdentityResource() { var command = IdentityResourceFaker.GenerateIdentiyResource().Generate(); await _identityResource.Save(command); var client = _database.IdentityResources.FirstOrDefault(s => s.Name == command.Name); client.Should().NotBeNull(); InMemoryData.DetachAll(); var updateCommand = IdentityResourceFaker.GenerateIdentiyResource().Generate(); await _identityResource.Update(command.Name, updateCommand); var ir = _database.IdentityResources.FirstOrDefault(f => f.Name == updateCommand.Name); ir.Should().NotBeNull(); ir.Name.Should().Be(updateCommand.Name); ir.Properties.Should().HaveCount(updateCommand.Properties.Count); }