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 assemblies = Assembly.GetEntryAssembly().GetReferencedAssemblies(); | |
foreach (var assembly in assemblies) | |
{ | |
Console.WriteLine($"{assembly.Version} {assembly.Name}"); | |
var codebase = Assembly.Load(assembly).CodeBase.Replace("file:///", ""); | |
Console.WriteLine($"\t{Path.GetDirectoryName(codebase)}"); | |
} |
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
app.UseCors(new CorsOptions() | |
{ | |
PolicyProvider = new CorsPolicyProvider() | |
{ | |
PolicyResolver = request => | |
{ | |
if (request.Path.StartsWithSegments(new PathString("/token"))) | |
{ | |
return Task.FromResult(new CorsPolicy { AllowAnyOrigin = true }); | |
} |
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
let PeriodValue payment rate period = | |
payment / ((1.0 + rate) ** period) | |
let PresentValue (factors: AnnuityFactors) = | |
[1 .. factors.Periods] | |
|> List.map (fun period -> PeriodValue factors.Payment factors.InterestRate (float period)) | |
|> List.sum |
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
<div ng-app="videoApp" ng-controller="VideoController"> | |
<table> | |
<thead> | |
<th>Title</th> | |
<th>Length</th> | |
<th></th> | |
</thead> | |
<tbody> | |
<tr data-id="{{video.Id}}" ng-repeat="video in videos"> |
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 FlexRoleUserStore<TContext, TRole, TUser> : IFlexRoleDataStore | |
where TRole : class, IFlexRole<TUser>, new() | |
where TUser : IFlexMembershipUser | |
where TContext : DbContext | |
{ | |
// ... | |
} |
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 OwershipVerification : IActionFilter | |
{ | |
public void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
foreach(var paramter in filterContext.ActionParameters) | |
{ | |
var haveAnOwner = paramter.Value as IHaveAnOwner; | |
if(haveAnOwner != null) | |
{ | |
var ownedParameter = haveAnOwner; |
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
using System; | |
using System.Linq; | |
using System.Data.Entity; | |
namespace TestEF | |
{ | |
public class Thing | |
{ | |
public int Id { | |
get; |
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
"dependencies": { | |
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7", | |
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", | |
"Microsoft.AspNet.StaticFiles": "1.0.0-beta7", | |
"Microsoft.AspNet.Diagnostics": "1.0.0-beta7", | |
"Microsoft.Framework.Logging.Console": "1.0.0-beta7", | |
"Microsoft.AspNet.Authorization": "1.0.0-beta7", | |
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta7" | |
}, |
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
using static System.Console; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
WriteLine("This works..."); | |
} |
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 Foo | |
{ | |
public Foo(int value) | |
{ | |
_value = value; | |
} | |
int _value; | |
} |