Decorator & Convention
public class Factory<T>
{
private Func<IResolver,T> constructor;
public Factory(Func<IResolver,T> constructor)
{
this.constructor = constructor;
}
public T Create(IResolver resolver)
{
return constructor(resolver);
}
}public class Convention<T>
{
private Action<T> apply;
public Convention(Action<T> apply)
{
this.apply = apply;
}
public void Apply(T t)
{
apply(t);
}
}Last updated