Skip to content

Commit fb2da83

Browse files
committed
Fix in monolithic part for issue dotnet-architecture#67 dotnet-architecture#67 ViewModels folder
1 parent 76be6db commit fb2da83

8 files changed

Lines changed: 18 additions & 31 deletions

File tree

src/Web/WebMonolithic/eShopWeb/Controllers/CatalogController.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Mvc;
6-
using eShopWeb.Models.CatalogViewModels;
7-
using eShopWeb.Models;
8-
using eShopWeb.Models.Pagination;
9-
using Microsoft.AspNetCore.Mvc.Rendering;
1+
using eShopWeb.Services;
2+
using eShopWeb.ViewModels;
103
using Microsoft.AspNetCore.Hosting;
4+
using Microsoft.AspNetCore.Mvc;
5+
using System;
116
using System.IO;
12-
using eShopWeb.Services;
7+
using System.Threading.Tasks;
138

149
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
1510

@@ -33,7 +28,7 @@ public async Task<IActionResult> Index(int? BrandFilterApplied, int? TypesFilter
3328
var itemsPage = 10;
3429
var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied);
3530

36-
var vm = new IndexViewModel()
31+
var vm = new CatalogIndex()
3732
{
3833
CatalogItems = catalog.Data,
3934
Brands = await _catalogSvc.GetBrands(),

src/Web/WebMonolithic/eShopWeb/Services/CatalogService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43
using System.Threading.Tasks;
54
using eShopWeb.Models;
65
using Microsoft.AspNetCore.Mvc.Rendering;
76
using eShopWeb.Infrastructure;
87
using Microsoft.EntityFrameworkCore;
98
using Microsoft.Extensions.Options;
10-
using Microsoft.Extensions.Configuration;
9+
using eShopWeb.ViewModels;
1110

1211
namespace eShopWeb.Services
1312
{

src/Web/WebMonolithic/eShopWeb/Services/ICatalogService.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
using eShopWeb.Models;
1+
using eShopWeb.ViewModels;
22
using Microsoft.AspNetCore.Mvc.Rendering;
3-
using System;
43
using System.Collections.Generic;
5-
using System.Linq;
64
using System.Threading.Tasks;
75

86
namespace eShopWeb.Services

src/Web/WebMonolithic/eShopWeb/Models/Catalog.cs renamed to src/Web/WebMonolithic/eShopWeb/ViewModels/Catalog.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
using System;
1+
using eShopWeb.Models;
22
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
53

6-
namespace eShopWeb.Models
4+
namespace eShopWeb.ViewModels
75
{
86
public class Catalog
97
{

src/Web/WebMonolithic/eShopWeb/Models/CatalogViewModels/IndexViewModel.cs renamed to src/Web/WebMonolithic/eShopWeb/ViewModels/CatalogIndex.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
using Microsoft.AspNetCore.Mvc.Rendering;
2-
using eShopWeb.Models.Pagination;
3-
using System;
1+
using eShopWeb.Models;
2+
using Microsoft.AspNetCore.Mvc.Rendering;
43
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Threading.Tasks;
74

8-
namespace eShopWeb.Models.CatalogViewModels
5+
namespace eShopWeb.ViewModels
96
{
10-
public class IndexViewModel
7+
public class CatalogIndex
118
{
129
public IEnumerable<CatalogItem> CatalogItems { get; set; }
1310
public IEnumerable<SelectListItem> Brands { get; set; }

src/Web/WebMonolithic/eShopWeb/Models/Pagination/PaginationInfo.cs renamed to src/Web/WebMonolithic/eShopWeb/ViewModels/PaginationInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Threading.Tasks;
55

6-
namespace eShopWeb.Models.Pagination
6+
namespace eShopWeb.ViewModels
77
{
88
public class PaginationInfo
99
{

src/Web/WebMonolithic/eShopWeb/Views/Catalog/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
ViewData["Title"] = "Catalog";
3-
@model eShopWeb.Models.CatalogViewModels.IndexViewModel
3+
@model eShopWeb.ViewModels.CatalogIndex
44
}
55
<section class="esh-catalog-hero">
66
<div class="container">

src/Web/WebMonolithic/eShopWeb/Views/Catalog/_pagination.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@model eShopWeb.Models.Pagination.PaginationInfo
1+
@model eShopWeb.ViewModels.PaginationInfo
22

33
<div class="esh-pager">
44
<div class="container">

0 commit comments

Comments
 (0)