This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<TSource> FromHierarchy<TSource>( | |
this TSource source, | |
Func<TSource, TSource> nextItem, | |
Func<TSource, bool> canContinue) | |
{ | |
for (var current = source; canContinue(current); current = nextItem(current)) | |
{ | |
yield return current; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///<sumary> | |
/// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 | |
///</sumary> | |
public enum Country { | |
///<sumary> | |
/// Andorra | |
///</sumary> | |
AD, | |
///<sumary> | |
/// United Arab Emirates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Validates ISBN13 codes | |
/// </summary> | |
/// <param name="isbn13">code to validate</param> | |
/// <returns>true, if valid</returns> | |
public static bool IsValidIsbn13(string isbn13) | |
{ | |
if (string.IsNullOrEmpty(isbn13)) | |
{ | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text.RegularExpressions; | |
namespace Utils.Text | |
{ | |
public static class NotAllowedCharacters | |
{ | |
private const string AccentsCharactersAllowed = "áéíóúâêîôûãõàèìòùäëïöüçñÁÉÍÓÚÂÊÎÔÛÃÕÀÈÌÒÙÄËÏÖÜÇÑ`´"; | |
private const string SpecialCharactersAllowed = "-+÷\\/><=≠.,:;\'\"!¡?¿{}[]()@#*&€$%*°ºª²³⅓⅔⅛⅜⅝⅞_"; | |
public static bool Contains(string text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ELO": { | |
"005": { | |
"kind": "reversivel", | |
"reason": "genérica", | |
"message": "contate a central do seu cartão" | |
}, | |
"051": { | |
"kind": "reversivel", | |
"reason": "SALDO/LIMITE INSUFICIENTE", |