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 (N2Configuration.Manual) | |
{ | |
N2Cms.Has.PagesOfType<HomePage>() | |
.UsingResourceType<TwoColumnPageResource<HomePage>>(); | |
N2Cms.Has.PagesOfType<TextPage>() | |
.UsingResourceType<TwoColumnPageResource<TextPage>>(); | |
N2Cms.Has.PagesOfType<NewsListPage>() | |
.UsingResourceType<NewsListPageResource>() |
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 newsPage = startPage.MakeChildOfType<NewsListPage>() | |
.Persist(); | |
newsPage.MakeChildrenOfType<NewsPage>(12) | |
.Persist(); | |
var textPages =startPage.MakeChildrenOfType<TextPage>(3) | |
.Persist(); | |
foreach (var textPage in textPages) |
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 ContentResourceResolverContributor : IPipelineContributor | |
{ | |
readonly IPageResourceRepository _pageResourceRepository; | |
readonly IPageResourceUriResolver _pageResourceUriResolver; | |
IEngine Engine { get; set; } | |
public ContentResourceResolverContributor(IEngine engine,IPageResourceRepository pageResourceRepository,IPageResourceUriResolver pageResourceUriResolver) | |
{ | |
_pageResourceRepository = pageResourceRepository; | |
_pageResourceUriResolver = pageResourceUriResolver; |
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.PagerFor(i => Html.ActionLink(i.ToString(),"Index","Technology",null,null,"audit",new {auditPage = i},null)) %> |
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
AutoMap.Assemblies(AdditionalAssemblies.Concat(New () {Assembly.GetExecutingAssembly()}).ToArray()) _ | |
.Where(Function(t) GetType(IEntity).IsAssignableFrom(t) OrElse t = GetType(TechnologySequence) OrElse t = GetType(DrugSequence) OrElse GetType(IEvent).IsAssignableFrom(t)) _ | |
.Setup(Function(s) InlineAssignHelper(s.IsComponentType, Function(type) GetType(IValueObject).IsAssignableFrom(type)))_ | |
.IncludeBase(GetType([Event])) _ | |
.IncludeBase(GetType(AggregateEvent))_ | |
.IncludeBase(GetType(ChangedCompanyUsers)) | |
.Conventions _.AddFromAssemblyOf(Of PrimaryKeyNameConvention)().UseOverridesFromAssemblyOf(Of IEntity)() |
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 When_searching_for_a_tag_by_name_with_two_matches : HandlerContext<IEnumerable<TagResource>, TagsController> | |
{ | |
Establish context = () => Stub<ISemaphoreService>() | |
.Setup(s => s.ByName(Moq.It.IsAny<string>())) | |
.Returns(new[] { new Term(1, "encoded term that is ambiguous"), | |
new Term(2, "encoded term that is ambiguous") }); | |
Because of = () => Get("tags/byname/encoded+term+that+is+ambiguous"); | |
It Has_a_resource_of_enumerable_tags = () => Has_expected_resource_type(); |
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
Will render the View 'Document' as the convention is from model type. If there's no view (or you force the content type), it will render it as xml / json / text/plain depending on negotiation | |
public static class Extensions | |
{ | |
public static ResourceResult NotFoundOnNull<TResult>(this ResourceController controller,Func<TResult> f) where TResult:class | |
{ | |
var result = f(); | |
return result == null ? controller.NotFound() : controller.OK(result); | |
} |
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 Source | |
{ | |
public class Child | |
{ | |
public string Name {get;set;} | |
} | |
public IEnumerable<Child> Children {get;set;} | |
} |
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
describe 'selecting a related term in the term viewer' | |
before_each | |
model = new ko.tagging.viewmodel() | |
tagging = $('#taggingContainer').tagging() | |
tagging.tagging("setmodel",model) | |
mock_request().and_return({Id : 1,Name: "test1",Paths:[ ],RelatedTo:[],BroaderTerms:[],NarrowerTerms:[]},'application/json') | |
model.termviewerviewmodel.selectedTerm({Id: 1, Name: "Tag 1"}) | |
end | |
it 'changes the currently selected term' | |
model.termviewerviewmodel.term().should.not.be_null |
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 SyndicatedContent | |
{ | |
public string Id { get; set; } | |
public JObject unknown { get; set; } | |
public XDocument doc { get; set; } | |
} | |
[Subject("Document storage")] | |
public class When_storing_content |
OlderNewer