forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/respect encapsulation (dotnet-architecture#349)
* resolve osbsolete method * put all properties as private, align unit test * fix version of version in MD, add instruction to install ef tool * fix url stored
- Loading branch information
1 parent
288d827
commit 3e22803
Showing
22 changed files
with
162 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
using Microsoft.eShopWeb.ApplicationCore.Interfaces; | ||
using Ardalis.GuardClauses; | ||
using Microsoft.eShopWeb.ApplicationCore.Interfaces; | ||
|
||
namespace Microsoft.eShopWeb.ApplicationCore.Entities | ||
{ | ||
public class CatalogItem : BaseEntity, IAggregateRoot | ||
{ | ||
public string Name { get; set; } | ||
public string Description { get; set; } | ||
public decimal Price { get; set; } | ||
public string PictureUri { get; set; } | ||
public int CatalogTypeId { get; set; } | ||
public CatalogType CatalogType { get; set; } | ||
public int CatalogBrandId { get; set; } | ||
public CatalogBrand CatalogBrand { get; set; } | ||
public string Name { get; private set; } | ||
public string Description { get; private set; } | ||
public decimal Price { get; private set; } | ||
public string PictureUri { get; private set; } | ||
public int CatalogTypeId { get; private set; } | ||
public CatalogType CatalogType { get; private set; } | ||
public int CatalogBrandId { get; private set; } | ||
public CatalogBrand CatalogBrand { get; private set; } | ||
|
||
public CatalogItem(int catalogTypeId, int catalogBrandId, string description, string name, decimal price, string pictureUri) | ||
{ | ||
CatalogTypeId = catalogTypeId; | ||
CatalogBrandId = catalogBrandId; | ||
Description = description; | ||
Name = name; | ||
Price = price; | ||
PictureUri = pictureUri; | ||
} | ||
|
||
public void Update(string name, decimal price) | ||
{ | ||
Guard.Against.NullOrEmpty(name, nameof(name)); | ||
Name = name; | ||
Price = price; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.