Skip to content

tyy-dev/Extendable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Common Extensions in my projects

Enum

enum MyEnum { 
  [EnumValue<string>("input")]
  Input,
  [EnumValue<string>("output")]
  Output
}

string inputValue = MyEnum.Input.Value<string>(); // Returns "input"

Type

Dictionary<string, PropertyInfo> propertyInfoMap = typeof(MyClass).MapProperties(p => p.CanRead); // Only properties that are readable,
                                                                                                  // PropertyName, PropertyInfo

String

"0".ParseNumberTypeAsType(); // => typeof(int)
"0".ParseNumberType(); // => "int"

No Examples

public static List<(T, T)> ZipToTuple<T>(this IEnumerable<T> first, IEnumerable<T> second)
public static T? TryDeserializeGroupCollection<T>(this Regex.GroupCollection groups)
public static IEnumerable<T>? TryDeserializeGroups<T>(this RegularExpressions.MatchCollection matchCollection)
public static bool IsEmpty(this System.Guid guid)
public static IEnumerable<PropertyInfo> FindProperties(this Type type, Func<PropertyInfo, bool>? selector = null, BindingFlags? bindingFlags = null)
public static bool HasProperty(this Type type, string propertyName, BindingFlags? bindingFlags = null)

About

Common Extensions I use in diff solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages