This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"TotalResults": 14, | |
"TotalPages": 3, | |
"Page": 1, | |
"_links": { | |
"self": { | |
"href": "/beers?page=1" | |
}, | |
"next": { | |
"href": "/beers?page=2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.CachedPartial( | |
//partial view name | |
"myPartialView", | |
//the model to pass the view - this will be the same object passed to the contextualKeyBuilder delegate | |
Model, | |
//seconds to cache | |
123, | |
//the key builder delegate, accepts the model passed in to the cached partial and the current | |
// viewdata dictionary of the partial view | |
contextualKeyBuilder: (model, viewdata) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var task = new Task(() => | |
{ | |
//do stuff; | |
}); | |
task.RunSynchronously(); | |
return task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static Task<TResult> RunSynchronously<TResult>(Func<TResult> func, CancellationToken cancellationToken = default(CancellationToken)) | |
{ | |
if (cancellationToken.IsCancellationRequested) | |
{ | |
return Canceled<TResult>(); | |
} | |
try | |
{ | |
return FromResult(func()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PackageBinaryInspector : MarshalByRefObject | |
{ | |
/// <summary> | |
/// Entry point to call from your code | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="dllPath"></param> | |
/// <param name="errorReport"></param> | |
/// <returns></returns> | |
/// <remarks> |
NewerOlder