Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Main()
- {
- // Write code to test your extensions here. Press F5 to compile and run.
- }
- public static class MyExtensions
- {
- // Write custom extension methods here. They will be available to all queries.
- public static IEnumerable<T> Prepend<T>(this IEnumerable<T> sequence, T element) =>
- new[] { element }.Concat(sequence);
- public static string Stringify<T>(this IEnumerable<T> sequence)
- {
- if (sequence.Count() == 0)
- {
- return "Empty";
- }
- return string.Join(",", sequence);
- }
- public static T DumpWithCurrentMethodName<T>(this T o, [CallerMemberName] string callerName = "")
- {
- return o.Dump(callerName);
- }
- }
- // You can also define non-static classes, enums, etc.
Add Comment
Please, Sign In to add comment