示例#1
0
        private static void VoteQuestion(UnverQuestion question)
        {
            var Question5 = new VerQuestion().V1Question(question);

            Question5.Match(
                QuestionVote =>
            {
                new VoteQuestion().SendPermisiuneToVote(QuestionVote);
                return(Unit.Default);
            },
                ex =>
            {
                Console.WriteLine("Can t Vote Question");
                return(Unit.Default);
            }
                );
        }
示例#2
0
        static void Main(string[] args)
        {
            var questionResult = UnverQuestion.Create("Yes", new List <string>()
            {
                "yes1", "yes2"
            });


            questionResult.Match(
                Succ: question =>
            {
                VoteQuestion(question);
                Console.WriteLine("good to vote ");
                return(Unit.Default);
            },
                Fail: ex =>
            {
                Console.WriteLine($"Error. Reason: {ex.Message}");
                return(Unit.Default);
            }
                );
            Console.ReadLine();
        }
示例#3
0
 public Result <V1Question> VQuestion(UnverQuestion question)
 {
     return(new GoodQuestion(question.Question, question.Tags));
 }