Refactoring Services (#61)

* Refactoring ViewModels into Razor Pages models

* Cleaning up Basket viewcomponent

* Refactoring services.
Fixed bug in basket item counter.
This commit is contained in:
Steve Smith
2017-10-23 10:52:33 -04:00
committed by GitHub
parent dea73a5f5e
commit 16d81ae450
28 changed files with 218 additions and 230 deletions

View File

@@ -1,7 +0,0 @@
namespace Microsoft.eShopWeb.RazorPages.ViewModels
{
public class BasketComponentViewModel
{
public int ItemsCount { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
namespace Microsoft.eShopWeb.RazorPages.ViewModels
{
public class OrderItemViewModel
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal Discount { get; set; }
public int Units { get; set; }
public string PictureUrl { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
using ApplicationCore.Entities.OrderAggregate;
using System;
using System.Collections.Generic;
namespace Microsoft.eShopWeb.RazorPages.ViewModels
{
public class OrderViewModel
{
public int OrderNumber { get; set; }
public DateTimeOffset OrderDate { get; set; }
public decimal Total { get; set; }
public string Status { get; set; }
public Address ShippingAddress { get; set; }
public List<OrderItemViewModel> OrderItems { get; set; } = new List<OrderItemViewModel>();
}
}

View File

@@ -1,24 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Microsoft.eShopWeb.RazorPages.ViewModels
{
public class RegisterViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}