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 EntityMatcher | |
{ | |
private readonly CompositeFilter<Type> _typeFilters = new CompositeFilter<Type>(); | |
private readonly EntityDetailsUrlPolicy _urlPolicy = new EntityDetailsUrlPolicy(); | |
private readonly IEntityViewModelResolver _entityViewModelResolver; | |
private BehaviorGraph _graph; | |
public EntityMatcher(IEntityViewModelResolver entityViewModelResolver) | |
{ | |
_entityViewModelResolver = entityViewModelResolver; |
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 VendorsController : Controller | |
{ | |
private readonly IRepository _repository; | |
private readonly IMappingRegistry _mappingRegistry; | |
public VendorsController(IRepository repository, IMappingRegistry mappingRegistry) | |
{ | |
_repository = repository; | |
_mappingRegistry = mappingRegistry; | |
} |
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 RenderEntityDetailsAction<TEntity, TRequestModel, TDetailsModel> | |
where TEntity : class | |
where TRequestModel : class | |
where TDetailsModel : class | |
{ | |
private readonly IEntityService _entityService; | |
private readonly IMappingRegistry _mappingRegistry; | |
public RenderEntityDetailsAction(IEntityService entityService, IMappingRegistry mappingRegistry) | |
{ |
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
[TestFixture] | |
public class When_Rendering_Entity_Details : InteractionContext<RenderEntityDetailsAction<Vendor, VendorRequestModel, VendorDetailsModel>> | |
{ | |
private VendorRequestModel _requestModel; | |
protected override void BeforeEach() | |
{ | |
_requestModel = new VendorRequestModel {VendorId = 1}; | |
} | |
[Test] |
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 EntityDetailsActionSource : IActionSource | |
{ | |
public IEnumerable<ActionCall> FindActions(TypePool types) | |
{ | |
var entityTypes = types.TypesMatching(t => RootEntityTypes.Types.Contains(t)); | |
foreach (var entityType in entityTypes) | |
{ | |
var handlerType = typeof(RenderEntityDetailsAction<>).MakeGenericType(entityType); | |
if (handlerType == null) |
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 BasicValidationRegistry : ValidationRegistry | |
{ | |
public BasicValidationRegistry() | |
{ | |
Scan(x => | |
{ | |
x.TheCallingAssembly(); | |
x.IncludeNamespaceContainingType<ModelMarker>(); | |
x.UseValidationAttributes(); | |
x.InheritValidationRules(); |
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 HelloWorldHtmlConventions : DefaultHtmlConventions | |
{ | |
private readonly ValidationGraph _graph; | |
public HelloWorldHtmlConventions(ValidationGraph graph) | |
{ | |
_graph = graph; | |
Editors | |
.If(a => a.Accessor.FieldName.Contains("Password")) | |
.Modify(t => t.Attr("type", "password")); |
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 SampleEndpoint | |
{ | |
private readonly ICommandExecutor _executor; | |
public SampleEndpoint(ICommandExecutor executor) | |
{ | |
_executor = executor; | |
} | |
public void Get() |
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
CommanderFactory.Initialize(facility, registry => | |
{ | |
registry | |
.Applies | |
.ToThisAssembly(); | |
registry | |
.Entities | |
.IncludeType<User>(); |
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
[TestFixture] | |
public class UserTester | |
{ | |
[TestFixtureSetUp] | |
public void FixtureSetUp() | |
{ | |
Integrator.Initialize(x => x.AddRegistry<HelloWorldStructureMapRegistry>(), new HelloWorldIntegratorRegistry()); | |
} | |
[Test] |
OlderNewer