Extension

13 views
Skip to first unread message

Ramon Smits

unread,
Apr 12, 2012, 9:08:43 AM4/12/12
to agath...@googlegroups.com


Maybe of any use for some people:

public static class AgathaExtensions
 {
  public static Lazy<K> Prepare<T,K>(this IRequestDispatcher dispatcher, T request)
   where K : Response
   where T : Request
  {
   var key = Guid.NewGuid().ToString();
   dispatcher.Add(key, request);
   return new Lazy<K>(() => dispatcher.Get<K>(key));
  }
 }


Reply all
Reply to author
Forward
0 new messages