File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
src/DistributedCache/Extensions Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -4,25 +4,28 @@ namespace DistributedCache.Extensions;
44
55public static class StringExtensions
66{
7- public static string PrefixWith ( this string value , string prefix )
8- {
9- return $ "{ prefix } { value } ";
10- }
117
12- public static string PrefixWith ( this string value , Assembly assembly )
8+ public static string PrefixWithAssemblyName ( this string value )
139 {
14- return $ "{ assembly . GetName ( ) . Name } :{ value } ";
10+ var assembly = Assembly . GetCallingAssembly ( ) ;
11+ return value . PrefixWith ( assembly . GetName ( )
12+ . Name ! ) ;
1513 }
1614
17- public static List < string > PrefixWith ( this IEnumerable < string > values , string prefix )
15+ public static List < string > PrefixWithAssemblyName ( this IEnumerable < string > values )
1816 {
19- return values . Select ( x => x . PrefixWith ( prefix ) )
17+ var assembly = Assembly . GetCallingAssembly ( ) . GetName ( ) . Name ;
18+ return values . Select ( x => x . PrefixWith ( assembly ! ) )
2019 . ToList ( ) ;
2120 }
2221
23- public static List < string > PrefixWith ( this IEnumerable < string > values , Assembly assembly )
22+ public static string PrefixWith ( this string value , string prefix )
23+ {
24+ return $ "{ prefix } { value } ";
25+ }
26+ public static List < string > PrefixWith ( this IEnumerable < string > values , string prefix )
2427 {
25- return values . Select ( x => x . PrefixWith ( assembly ) )
28+ return values . Select ( x => x . PrefixWith ( prefix ) )
2629 . ToList ( ) ;
2730 }
2831}
You can’t perform that action at this time.
0 commit comments