public static Task <IHttpResponse> HttpDeleteAsync <TResource>( this IRef <TResource> resourceRef, NoContentResponse onDeleted, NotFoundResponse onNotFound) where TResource : IReferenceable { return(resourceRef.StorageDeleteAsync( onDeleted: (discard) => onDeleted(), () => onNotFound())); }
public static Task <TResult> DeleteInternalAsync <TResult>( IRef <XIntegration> integrationRef, Func <TResult> onDeleted, Func <TResult> onNotFound) { return(integrationRef.StorageDeleteAsync( onDeleted: (discard) => { return onDeleted(); }, () => onNotFound())); }
public static Task <TResult> DeleteInternalAsync <TResult>( IRef <XIntegration> integrationRef, Api.Azure.AzureApplication application, Func <TResult> onDeleted, Func <TResult> onNotFound) { return(integrationRef.StorageDeleteAsync( () => { return onDeleted(); }, () => onNotFound())); }
public static Task <IHttpResponse> DeleteAsync( [UpdateId(Name = SessionIdPropertyName)] IRef <Session> sessionRef, NoContentResponse onDeleted, NotFoundResponse onNotFound) { return(sessionRef.StorageDeleteAsync( onDeleted: (discard) => { return onDeleted(); }, onNotFound: () => onNotFound())); }
public static Task <HttpResponseMessage> DeleteAsync( [UpdateId(Name = SessionIdPropertyName)] IRef <Session> sessionRef, Api.Azure.AzureApplication application, NoContentResponse onDeleted, NotFoundResponse onNotFound) { return(sessionRef.StorageDeleteAsync( () => { return onDeleted(); }, onNotFound: () => onNotFound())); }
public static async Task <TResult> DeleteInternalAsync <TResult>( IRef <Integration> integrationRef, Api.Azure.AzureApplication application, Func <TResult> onDeleted, Func <TResult> onNotFound) { var integrationMaybe = await integrationRef.StorageGetAsync(i => i, () => default(Integration?)); if (!integrationMaybe.HasValue) { return(onNotFound()); } var integration = integrationMaybe.Value; return(await await integrationRef.StorageDeleteAsync( onDeleted: async(discard) => { if (integration.authorization.HasValue) { var authorizationId = integration.authorization.id.Value; var authorizationLookupRef = authorizationId.AsRef <AuthorizationIntegrationLookup>(); await authorizationLookupRef.StorageDeleteAsync( onDeleted: (discard) => true); } var accountIntegrationRef = integration.accountId.AsRef <AccountIntegrationLookup>(); await accountIntegrationRef.StorageUpdateAsync( async(accountLookup, saveAsync) => { accountLookup.integrationRefs = accountLookup.integrationRefs.ids .Where(id => id != integration.id) .AsRefs <Integration>(); await saveAsync(accountLookup); return true; }); return onDeleted(); }, () => onNotFound().AsTask())); }