Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Last active April 21, 2020 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominicFinn/49420b95432ce70035eba385765e8ac3 to your computer and use it in GitHub Desktop.
Save DominicFinn/49420b95432ce70035eba385765e8ac3 to your computer and use it in GitHub Desktop.
Avoid this
using System;
namespace DeepObjects.Models
{
internal enum CatStatus
{
Outstanding
}
internal sealed class CatDetails
{
public CatStatus Status { get; set; }
public string CatMessage { get; set; }
}
internal sealed class Cat
{
public CatDetails Status { get; set; }
}
internal sealed class IndexViewModel
{
public Cat Cat { get; set; }
}
}
@model IndexViewModel
@{
ViewData["Title"] = "guaranteed problem page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
@if(string.IsNullOrEmpty(Model?.Cat?.Status?.CatMessage))
{
<p>What is happening to me....?</p>
<p>Why am I here?</p>
}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment