Skip to content

Instantly share code, notes, and snippets.

@escalonn
Created September 4, 2020 18:59
Show Gist options
  • Save escalonn/8ed83262139649aa4251f6e064b4372f to your computer and use it in GitHub Desktop.
Save escalonn/8ed83262139649aa4251f6e064b4372f to your computer and use it in GitHub Desktop.
var restaurant = new Restaurant() {
Id = 1,
Name = "My Kitchen 1",
Address = "New Brunswick, 2657 Webster Street",
Speciality = "Hamburgers",
Open = true,
Review = 4
};
return View(restaurant);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BindViews.Models
{
public class Restaurant
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public bool Open { get; set; }
public string Speciality { get; set; }
public int Review { get; set; }
}
}
@model BindViews.Models.Restaurant
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link rel="stylesheet" type="text/css" href="~/css/style-sheet.css" />
</head>
<body>
<h1>Restaurant Information</h1>
<div>
<p><b>Name</b>: @Model.Name</p>
<hr />
<p><b>Address</b>: @Model.Address</p>
<hr />
<p><b>Speciality</b>: @Model.Speciality</p>
<hr />
<p><b>Is Open</b>: @Model.Open</p>
<hr />
<p><b>Rating</b>: @Model.Review</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment