Файли
openidea/fixtures/aspnet-app/Models/Show.cs
T
Glitched Polygons GmbH 75ec6c51a3 feat(csharp): Razor / cshtml / ASP.NET Core MVC support (#7256)
Razor (.cshtml/.razor) gets syntax highlighting, Roslyn's built-in Razor support with the HTML parts projected to the HTML language server (ordered open/close, a reserved projection URI, scoped capability registrations), and MVC navigation between controller actions and their views, including explicit View("...") names, subfolders and areas.

Closes #615

Co-authored-by: GlitchedPolygons <[email protected]>
2026-12-02 16:32:46 +08:00

23 рядки
842 B
C#

namespace Ticketing.Models;
public enum Genre
{
Jazz,
Comedy,
Theatre,
}
/// <summary>A show on sale. <see cref="Slug"/> is its id in URLs.</summary>
public sealed record Show(string Slug, string Title, Genre Genre, DateOnly Date, string Venue, decimal Price, int Capacity)
{
public static readonly IReadOnlyList<Show> All =
[
new("jazz-night", "Jazz Night", Genre.Jazz, new DateOnly(2027, 1, 15), "The Cellar", 25m, 120),
new("stand-up-sunday", "Stand-up Sunday", Genre.Comedy, new DateOnly(2027, 1, 17), "Harbour Hall", 0m, 80),
new("the-tempest", "The Tempest", Genre.Theatre, new DateOnly(2027, 2, 3), "Lindenhof Theatre", 42.5m, 8),
];
// FIXME: shows are hard-coded until there is a database.
public static Show? Find(string slug) => All.FirstOrDefault(s => s.Slug == slug);
}