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 RedirectNodesWithoutTemplate : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
PublishedContentRequest.Prepared += PublishedContentRequest_Prepared; | |
base.ApplicationStarted(umbracoApplication, applicationContext); | |
} | |
private void PublishedContentRequest_Prepared(object sender, System.EventArgs e) | |
{ |
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 System.ComponentModel.DataAnnotations; | |
public class Category | |
{ | |
private Category() | |
{ | |
} | |
public Category(string name) | |
{ |
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.EntityFrameworkCore; | |
public class ToDoContext : DbContext | |
{ | |
public ToDoContext(DbContextOptions<ToDoContext> options) | |
: base(options) | |
{ | |
} | |
public DbSet<Category> Categories { 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
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using AutoMapper; | |
using MediatR; | |
using Microsoft.AspNetCore.Mvc.Rendering; | |
using Microsoft.EntityFrameworkCore; | |
public class TasksEditViewModel | |
{ |
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 System.Threading.Tasks; | |
using MediatR; | |
public class TaskCompleteCommand : IAsyncRequest<CommandResult> | |
{ | |
public int Id { get; set; } | |
} | |
public class TaskCompleteCommandHandler : CommandHandlerBase, | |
IAsyncRequestHandler<TaskCompleteCommand, CommandResult> |
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 System.Reflection; | |
using AutoMapper; | |
using MediatR; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
public class Startup |
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 System.Threading.Tasks; | |
using AutoMapper; | |
using MediatR; | |
using Microsoft.AspNetCore.Mvc; | |
public class TasksController : Controller | |
{ | |
private readonly IMediator _mediator; | |
private readonly IMapper _mapper; | |
private const string NotificationMessageKey = "NotificationMessage"; |
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.ActionLink("Edit", "Edit", "Tasks", new { @class = "edit-link", data_foo = "bar" }) |
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
<a asp-controller="Tasks" asp-action="Edit" asp-route-id="@item.Id" class="edit-link" data-foo="bar">Edit</a> |
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using Microsoft.Bot.Builder.FormFlow; | |
public class RoomBookingDialog | |
{ | |
public enum OfficeLocationOptions | |
{ | |
Bristol = 1, |
OlderNewer