public static IOption <UserMessage> MapToUserMessage <A>(this ITry <A> aTry, Func <A, IOption <UserMessage> > mapper) { return(aTry.Match(mapper, e => Option.Create(UserMessage.Error(e)))); }
public static Task <IOption <UserMessage> > MapToUserMessageAsync <A>(this ITry <Task <A> > aTry, Func <A, IOption <UserMessage> > mapper) { return(aTry.Match(r => r.Map(mapper), e => Task.FromResult(Option.Create(UserMessage.Error(e))))); }