Skip to content

Instantly share code, notes, and snippets.

View AndyButland's full-sized avatar

Andy Butland AndyButland

View GitHub Profile
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);
}
imageUrlGeneratorMock
.Setup(x => x.GetImageUrl(It.IsAny<ImageUrlGenerationOptions>()))
.Returns("/test.png");
imageUrlGeneratorMock
.Setup(x => x.GetImageUrl(It.Is<ImageUrlGenerationOptions>(y => y.Height == Height)))
.Returns("/test.png");
public async Task Get(string id)
{
var response = await_authorizedServiceCaller.GetRequestAsyncContactResponse>(
"hubspot",
$"/crm/v3/objects/contacts/{id}");
if (response == null)
{
return NotFound();
}
[ApiExplorerSettings(GroupName = "forms")]
builder.Services.ConfigureOptions<ConfigureUmbracoFormsApiSwaggerGenOptions>();
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)
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)
{
"gotoPageOnSubmitRoute": {
"path": "/contact-us/thanks/",
"startItem": {
"id": "ca4249ed-2b23-4337-b522-63cabe5587d1",
"path": "home"
}
}
public IApiContentRoute? GotoPageOnSubmitRoute { get; set; }