Esempio n. 1
0
 public static bool IsValid(this EarnTask task)
 {
     if (task.Id.IsNullOrBlank() || task.Title.IsNullOrBlank() ||
         task.Description.IsNullOrBlank() || task.Type.IsNullOrBlank() ||
         task.Memo.IsNullOrBlank() ||
         !task.KinReward.HasValue || !task.MinToComplete.HasValue ||
         !task.Provider.HasValue || task.Questions == null ||
         !task.StartDateInSeconds.HasValue || !task.LastUpdatedAt.HasValue)
     {
         return(false);
     }
     return(task.Questions.TrueForAll(question => question.IsValid()) &&
            task.Provider.Value.IsValid());
 }
Esempio n. 2
0
 public static long?StartDateInMillis(this EarnTask task) => task.StartDateInSeconds * 1000;
Esempio n. 3
0
 public static bool IsTaskWebView(this EarnTask task) =>
 task.Type == EarnTask.TASK_TYPE_TRUEX;
Esempio n. 4
0
 public static string Tags(this EarnTask task) =>
 string.Join(",", task.Tags);
Esempio n. 5
0
 public static bool IsQuestionnaire(this EarnTask task) =>
 task.Type == EarnTask.TASK_TYPE_QUESTIONNAIRE;