1
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
namespace BITKit
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
|
||||
|
||||
public interface IReference
|
||||
{
|
||||
string Get();
|
||||
@@ -7,6 +13,15 @@
|
||||
string Replace(string value) => Get().Replace("{x}",value);
|
||||
}
|
||||
|
||||
public static class IReferenceExtensions
|
||||
{
|
||||
public static string[] Cast(this IEnumerable<IReference> self)
|
||||
{
|
||||
return self.Select(Get).ToArray();
|
||||
string Get(IReference x) => x.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IReference<T>
|
||||
{
|
||||
T Get();
|
||||
|
Reference in New Issue
Block a user