Breaking 05_03 in twain
This commit is contained in:
@ -57,8 +57,8 @@
|
||||
<Compile Include="Models\Review.cs" />
|
||||
<Compile Include="Models\ShoppingCart.cs" />
|
||||
<Compile Include="Models\ShoppingCartItem.cs" />
|
||||
<Compile Include="Requests\UpdateProductRequest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Requests\UpdateProductRequest.cs" />
|
||||
<Compile Include="Services\ProductUpdateService.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@ -125,7 +125,7 @@ namespace HPlusSports
|
||||
return
|
||||
Regex.Replace(
|
||||
Regex.Replace(
|
||||
source,
|
||||
source.Replace("<h2>Description</h2>", ""),
|
||||
"<[^>]*>",
|
||||
""
|
||||
),
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace HPlusSports.Models
|
||||
{
|
||||
public class UpdateProductRequest
|
||||
{
|
||||
[Required]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public long CategoryId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SKU { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Text)]
|
||||
public string Summary { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Range(minimum: 0, maximum: double.MaxValue)]
|
||||
[DataType(DataType.Currency)]
|
||||
public double MSRP { get; set; }
|
||||
|
||||
[Range(minimum: 0, maximum: double.MaxValue)]
|
||||
[DataType(DataType.Currency)]
|
||||
public double Price { get; set; }
|
||||
|
||||
public string LastUpdatedUserId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -40,4 +40,4 @@ namespace HPlusSports.Requests
|
||||
|
||||
public string LastUpdatedUserId { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using HPlusSports.Requests;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HPlusSports.Requests;
|
||||
|
||||
namespace HPlusSports.Services
|
||||
{
|
||||
@ -38,8 +38,8 @@ namespace HPlusSports.Services
|
||||
existing.Price = request.Price;
|
||||
existing.SKU = request.SKU;
|
||||
existing.Summary = request.Summary;
|
||||
|
||||
existing.LastUpdated = DateTime.UtcNow;
|
||||
existing.LastUpdatedUserId = request.LastUpdatedUserId;
|
||||
|
||||
_context.SaveChanges();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user