
@{
    ViewBag.Title = $"MyViewRazor Count: {ViewBag.Count}";
    string today = DateTime.Now.ToShortDateString();

    int count = ViewBag.Count;

	string[] list = { "Apple", "Banana", "Coconut", "Durian" };
}

<h2>@ViewBag.Title</h2>
<h4>@today</h4>

<p>
	@*조건문*@
	@if (count <= 0)
	{
		<div>데이터가 없습니다.</div>

	}
	else
	{
		<div>@count 개의 데이터가 있습니다. </div>

	}
	<br />

	@switch (count)
	{
		case 1:
			<div>하나</div>
			break;
		case 2:
			<div>둘</div>
			break;
		default:
			<div>셋 이상</div>
			break;
	}
	<br />

	@for (int i = 0; i < count; i++)
	{
		<div>@i</div>
	}
	<br />

	@foreach (var elem in list)
	{
		<div>Elem: @elem</div>
	}
	<br />

	@{ int ix = 1; }
	@while (ix < 10)
	{
		<div>@ix</div>
		ix++;
	}
</p>

