forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensions.cs
More file actions
26 lines (23 loc) · 697 Bytes
/
Extensions.cs
File metadata and controls
26 lines (23 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
namespace ServiceStack
{
// Some extension methods copied various parts of SS
public static class Extensions
{
public static void Each<T>(this IEnumerable<T> values, Action<T> action)
{
if (values == null) return;
foreach (var value in values)
{
action(value);
}
}
public static string GetOperationName(this Type type)
{
return type.FullName != null //can be null, e.g. generic types
? type.FullName.Replace(type.Namespace + ".", "").Replace("+", ".")
: type.Name;
}
}
}