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
| private void BootAutoFac() | |
| { | |
| var builder = new ContainerBuilder(); | |
| var assemblies = AppDomain.CurrentDomain.GetAssemblies() | |
| .Where(x => x.FullName.StartsWith("Your.Namespace")).ToArray(); | |
| builder.RegisterAssemblyTypes(assemblies) | |
| .Where(t => t.IsClass) |
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
| <?php | |
| function get_groups($user) { | |
| // Active Directory server | |
| $ldap_host = "ad.domain"; | |
| // Active Directory DN, base path for our querying user | |
| $ldap_dn = "CN=Users,DC=ad,DC=domain"; | |
| // Active Directory user for querying | |
| $query_user = "jane@".$ldap_host; |
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 Person | |
| { | |
| public int Id { get; set; } | |
| public string FirstName { get; set; } | |
| public string LastName { get; set; } | |
| } | |
| public class PersonService | |
| { | |
| public Person GetPerson(int id) |
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 LoggingAspect : IInterceptor | |
| { | |
| private readonly ILogger logger; | |
| private readonly Stopwatch stopwatch; | |
| public LoggingAspect(ILogger logger) | |
| { | |
| this.logger = logger; | |
| this.stopwatch = new Stopwatch(); | |
| } |
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
| [Test] | |
| public void should_map_to_recipe_controller() | |
| { | |
| "~/Recipe".ShouldMapTo<recipecontroller>(action => action.Healthy()); | |
| } |
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
| [TestFixtureSetUp] | |
| public void TestSetup() | |
| { | |
| var routes = RouteTable.Routes; | |
| routes.Clear(); | |
| routes.MapRoute( | |
| "Default", | |
| "{controller}", | |
| new {controller = "Recipe", action = "Healthy", id = ""} |
NewerOlder