Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async ready Chain function to Chain multiple ErrorOr #31

Conversation

lucafabbri
Copy link

Chain is a function to simplify cases where operation should happen sequntially only if the previous one is successful.

return await entityFactory.FromDTO(config).Chain<ConfigDTO>( async config => { return await item.Update(config).Chain<ConfigDTO>( async updated => { return (await context.AddOrUpdate(item)).Chain<ConfigDTO>( config => { return mapper.Map<ConfigDTO>(config); }); }); });

@amantinband
Copy link
Owner

Thanks for this @lucafabbri, added as Then/ThenAsync in 1.6.0 #77

@amantinband amantinband closed this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants