Skip to content

Commit

Permalink
feat : add product comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikoo-Asadnejad committed Jan 11, 2024
1 parent 6a5ff79 commit 047ffaf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using Product.Domain.Aggregates.Product.Entities;
using Product.Domain.Base;

namespace Product.Domain.Aggregates.ProductAggregate;

public sealed class ProductModel : BaseEntity
{

public ProductModel(string title, int price ,long? categoryId = null, string? subTitle = null, string? description = null)
public ProductModel(string title, int price, long? categoryId = null, string? subTitle = null,

Check warning on line 8 in Src/Product.Domain/Aggregates/Product/AggregateRoot/ProductModel.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Category' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 8 in Src/Product.Domain/Aggregates/Product/AggregateRoot/ProductModel.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property '_productComments' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
string? description = null)
{
Title = title;
SubTitle = subTitle;
Expand All @@ -19,9 +20,16 @@ public ProductModel(string title, int price ,long? categoryId = null, string? su
public string? Description { get; private set; }
public int Price { get; private set; }
public long? CategoryId { get; private set; }

public CategoryModel Category { get; private set; }


public IReadOnlyList<ProductComment> ProductComments
{
get { return _productComments; }
}

private List<ProductComment> _productComments { get; set; }

public void Update(ProductModel newProduct)
{
base.Update(newProduct.CreateIp);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Product.Domain.Aggregates.Product.Entities;

public class ProductComment
{

}
1 change: 0 additions & 1 deletion Src/Product.Domain/Product.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<ItemGroup>
<Folder Include="Aggregates\Category\Exceptions" />
<Folder Include="Aggregates\Category\ValueObjects" />
<Folder Include="Aggregates\Product\Entities" />
<Folder Include="Aggregates\Product\Exceptions" />
</ItemGroup>

Expand Down

0 comments on commit 047ffaf

Please sign in to comment.