Exemplo n.º 1
0
            public override void Validate(string input, string field)
            {
                if (String.IsNullOrEmpty(input) || String.IsNullOrWhiteSpace(input))
                {
                    throw new Exception($"The field '{field}' may not be empty.");
                }

                if (Feed.CheckIfChannelURLExist(input, FeedList))
                {
                    throw new Exception($"Channel with that URL is already added");
                }

                if (!Uri.IsWellFormedUriString(input, UriKind.Absolute))
                {
                    throw new Exception($"Entry of field '{field}' is not a valid RSS URL.");
                }
            }