Exemplo n.º 1
0
        public static async Task <Operation <T> > Run <T>(Func <Task <T> > process)
        {
            var operation = new Operation <T>();

            try
            {
                operation.Result = await process();

                operation.Succeeded = true;
            }
            catch (Exception ex)
            {
                operation.Catch(ex);
            }
            return(operation);
        }