This file contains hidden or 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 StructureMapNancyBootstrapper : StructureMapNancyBootstrapperBase | |
| { | |
| public StructureMapNancyBootstrapper() : base(typeof(MyModule).Assembly) | |
| { | |
| } | |
| protected override IContainer GetApplicationContainer() | |
| { | |
| return new Container(); | |
| } |
This file contains hidden or 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.Collections.Generic; | |
| using System.Linq; | |
| using System.Web.Http.Dependencies; | |
| using StructureMap; | |
| public class StructureMapResolver : IDependencyScope, IDependencyResolver | |
| { | |
| private readonly IContainer _container; | |
| private readonly bool _isContainerOwner; |
This file contains hidden or 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
| @{ | |
| Func<ModelMetadata, bool> shouldShow = metadata => | |
| { | |
| return metadata.ShowForEdit | |
| //&& metadata.ModelType != typeof(System.Data.EntityState) | |
| && !metadata.IsComplexType | |
| && !ViewData.TemplateInfo.Visited(metadata); | |
| }; | |
| } | |
| @if (ViewData.TemplateInfo.TemplateDepth > 1) |
This file contains hidden or 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 static class CryptographyExtensions | |
| { | |
| /// <summary> | |
| /// Calculates the MD5 hash for the given string. | |
| /// </summary> | |
| /// <returns>A 32 char long MD5 hash.</returns> | |
| public static string GetHashMd5(this string input) | |
| { | |
| return ComputeHash(input, new MD5CryptoServiceProvider()); | |
| } |
NewerOlder