Skip to content

Commit 50ab7d6

Browse files
Nitish KaushikNitish Kaushik
Nitish Kaushik
authored and
Nitish Kaushik
committed
Part:15 View - Added views
1 parent 206427e commit 50ab7d6

File tree

6 files changed

+64
-7
lines changed

6 files changed

+64
-7
lines changed

Webgentle.BookStore/Webgentle.BookStore/Controllers/BookController.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ public BookController()
1717
_bookRepository = new BookRepository();
1818
}
1919

20-
public List<BookModel> GetAllBooks()
20+
public ViewResult GetAllBooks()
2121
{
22-
return _bookRepository.GetAllBooks();
22+
var data = _bookRepository.GetAllBooks();
23+
24+
return View();
2325
}
2426

2527
public BookModel GetBook(int id)

Webgentle.BookStore/Webgentle.BookStore/Controllers/HomeController.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ namespace Webgentle.BookStore.Controllers
88
{
99
public class HomeController : Controller
1010
{
11-
public string Index()
11+
public ViewResult Index()
1212
{
13-
return "WebGentle";
13+
return View();
14+
}
15+
16+
public ViewResult AboutUs()
17+
{
18+
return View();
1419
}
1520
}
1621
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
@{
3+
Layout = null;
4+
}
5+
6+
<!DOCTYPE html>
7+
8+
<html>
9+
<head>
10+
<meta name="viewport" content="width=device-width" />
11+
<title>GetAllBooks</title>
12+
</head>
13+
<body>
14+
<h1>All book list</h1>
15+
<button>Click me</button>
16+
</body>
17+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
@{
3+
Layout = null;
4+
}
5+
6+
<!DOCTYPE html>
7+
8+
<html>
9+
<head>
10+
<meta name="viewport" content="width=device-width" />
11+
<title>AboutUs</title>
12+
</head>
13+
<body>
14+
<h1>This is the about page of application</h1>
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
@{
3+
Layout = null;
4+
}
5+
6+
<!DOCTYPE html>
7+
8+
<html>
9+
<head>
10+
<meta name="viewport" content="width=device-width" />
11+
<title>Index</title>
12+
</head>
13+
<body>
14+
<h1>Welcome to book store application</h1>
15+
<p>This is the home page of our book store application</p>
16+
</body>
17+
</html>

Webgentle.BookStore/Webgentle.BookStore/Webgentle.BookStore.csproj.user

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
99
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
1010
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
11-
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
11+
<WebStackScaffolding_IsLayoutPageSelected>False</WebStackScaffolding_IsLayoutPageSelected>
1212
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
13-
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
14-
<WebStackScaffolding_LayoutPageFile />
13+
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
1514
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
15+
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
1616
</PropertyGroup>
1717
</Project>

0 commit comments

Comments
 (0)