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 commands = new List<ImageUrlGenerationOptions>(); | |
imageUrlGeneratorMock.Verify(x => x.GetImageUrl(Capture.In(commands, cmd => true))); | |
foreach (ImageUrlGenerationOptions command in commands) | |
{ | |
System.Diagnostics.Debug.WriteLine(command.Height); | |
} |
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
imageUrlGeneratorMock | |
.Setup(x => x.GetImageUrl(It.IsAny<ImageUrlGenerationOptions>())) | |
.Returns("/test.png"); |
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
imageUrlGeneratorMock | |
.Setup(x => x.GetImageUrl(It.Is<ImageUrlGenerationOptions>(y => y.Height == Height))) | |
.Returns("/test.png"); |
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
@* | |
Demonstration of using the Umbraco Forms API for retrieving the definition of a form, rendering it and posting an entry. | |
It's based off an Umbraco content item with a property with alias "Form", of type "Form Picker". | |
*@ | |
@using Microsoft.AspNetCore.Antiforgery | |
@using Microsoft.Extensions.Options; | |
@using Umbraco.Cms.Web.Common.PublishedModels; | |
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.AJaxformPage> | |
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels; |
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
{ | |
"name": "Contact Us", | |
"route": { | |
"path": "/contact-us/", | |
"startItem": { | |
"id": "ca4249ed-2b23-4337-b522-63cabe5587d1", | |
"path": "home" | |
} | |
}, | |
"id": "4a1f4198-e143-48ba-a0f5-1a7ef2df23aa", |
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
[ApiExplorerSettings(GroupName = "forms")] |
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
builder.Services.ConfigureOptions<ConfigureUmbracoFormsApiSwaggerGenOptions>(); |
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 Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Options; | |
using Microsoft.OpenApi.Models; | |
using Swashbuckle.AspNetCore.SwaggerGen; | |
namespace Umbraco.Forms.Web.Configuration | |
{ | |
public class ConfigureUmbracoFormsApiSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions> | |
{ | |
public void Configure(SwaggerGenOptions options) |
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
private void PopulateGotoPageOnSubmit(Form form, FormDto dto) | |
{ | |
if (form.GoToPageOnSubmit == 0) | |
{ | |
return; | |
} | |
Attempt<Guid> gotToPageKeyAttempt = _entityService.GetKey(form.GoToPageOnSubmit, UmbracoObjectTypes.Document); | |
if (gotToPageKeyAttempt.Success == false) | |
{ |
NewerOlder