Skip to content

Instantly share code, notes, and snippets.

internal static class TaskHelper
{
internal static Task<T> FromException<T>(Exception ex)
{
var completion = new TaskCompletionSource<T>();
completion.SetException(ex);
return completion.Task;
}
internal static Task<T> FromCancellation<T>()
internal sealed class DynamicEqualityComparer<T> : IEqualityComparer<T>
where T : class
{
private readonly Func<T, T, bool> _func;
public DynamicEqualityComparer(Func<T, T, bool> func)
{
DebugCheck.NotNull(func);
_func = func;
@CleanCoder
CleanCoder / DB
Created January 23, 2018 01:33
DB
using EntityFramework;
using EntityFramework.Mapping;
using EntityFramework.Reflection;
using Next.Dal.Entity;
using Next.Dal.Repertory;
using Next.Dal.Repertory.DbRepertory;
using Next.Dal.Repertory.MemoryRepertory;
using Spring.Reflection.Dynamic;
using System;
using System.Collections.Generic;
@CleanCoder
CleanCoder / ExternalConfigurationManager From MS.txt
Last active December 13, 2017 01:52
ExternalConfigurationManager From MS
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace ExternalConfigurationStore.Cloud
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading;
// 页面定时刷新
<head>
@if (ViewBag.RefreshSeconds != null && ViewBag.RefreshSeconds > 0)
{
<meta http-equiv="refresh" content="@ViewBag.RefreshSeconds">
}
</head>