Skip to content

Instantly share code, notes, and snippets.

if (!this.stream.CanSeek)
{
var tcs = new TaskCompletionSource<Stream>();
var buffer =
new MemoryStream((int)this.stream.Length);
this.stream.CopyTo(buffer, (source, destination, ex) =>
{
if (ex != null)
{
@grumpydev
grumpydev / IRoboCop.cs
Created September 9, 2011 08:19 — forked from skoon/IRoboCop.cs
public interface IJudgeDredd
{
void IAmTheLaw();
}
public interface IRoboCop : IJudgeDredd
{
void ServeThePublicTrust();
public class DefaultViewCache : IViewCache
{
private readonly ConcurrentDictionary<ViewLocationResult, object> cache;
public DefaultViewCache()
{
this.cache = new ConcurrentDictionary<ViewLocationResult, object>();
}
public TCompiledView GetOrAdd<TCompiledView>(string viewLocationResult, Func<string, TCompiledView> valueFactory)