public async Task <IActionResult> DeleteOrganization(DeleteOrganizationDto deleteOrganizationDto) { //#MISSING: VALIDATE THAT USSER LOGGED BELONGS TO USER ORGANIZATION var result = await _organizationService.DeleteOrganization(deleteOrganizationDto.Id); var response = new ApiResponse <bool>(result); return(Ok(response)); }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteOrganizationDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); OrganizationsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _organizationApplicationService.When(value as IDeleteOrganization); } catch (Exception ex) { var response = OrganizationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteOrganizationDto c) { var idObj = (c as IDeleteOrganization).OrganizationId; var uriParameters = new OrganizationUriParameters(); uriParameters.Id = idObj; var q = new OrganizationDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new OrganizationDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.Organization.Delete(req); OrganizationProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteOrganizationDto c) { WhenAsync(c).GetAwaiter().GetResult(); }