public static bool AddProblem(Problem problem, string pattern_a, string pattern_img, string URL) { if (problem.Title.Length <= 0) { return(false); } problem.Description = Link(problem.Description, pattern_a, URL); problem.Description = Link(problem.Description, pattern_img, URL); problem.Input = Link(problem.Input, pattern_a, URL); problem.Input = Link(problem.Input, pattern_img, URL); problem.Output = Link(problem.Output, pattern_a, URL); problem.Output = Link(problem.Output, pattern_img, URL); problem.SampleInput = Link(problem.SampleInput, pattern_a, URL); problem.SampleInput = Link(problem.SampleInput, pattern_img, URL); problem.SampleOutput = Link(problem.SampleOutput, pattern_a, URL); problem.SampleOutput = Link(problem.SampleOutput, pattern_img, URL); problem.Hint = Link(problem.Hint, pattern_a, URL); problem.Hint = Link(problem.Hint, pattern_img, URL); ProblemService.Insert(problem); return(true); }