This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
194 additions
and
85 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
test/Stove.Tests.SampleApplication/Domain/Entities/Brand.cs
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("Brand")] | ||
public class Brand : Entity | ||
{ | ||
private Brand() | ||
{ | ||
} | ||
|
||
[Required] | ||
[NotNull] | ||
public virtual string Name { get; protected set; } | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
test/Stove.Tests.SampleApplication/Domain/Entities/Cart.cs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
test/Stove.Tests.SampleApplication/Domain/Entities/Category.cs
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("Category")] | ||
public class Category : Entity | ||
{ | ||
private Category() | ||
{ | ||
} | ||
|
||
[Required] | ||
public virtual string Name { get; protected set; } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
test/Stove.Tests.SampleApplication/Domain/Entities/Gender.cs
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("Gender")] | ||
public class Gender : Entity | ||
{ | ||
private Gender() | ||
{ | ||
} | ||
|
||
[Required] | ||
public virtual string Name { get; protected set; } | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
test/Stove.Tests.SampleApplication/Domain/Entities/Order.cs
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
test/Stove.Tests.SampleApplication/Domain/Entities/OrderDetail.cs
This file was deleted.
Oops, something went wrong.
40 changes: 27 additions & 13 deletions
40
test/Stove.Tests.SampleApplication/Domain/Entities/Product.cs
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,29 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Stove.Domain.Entities; | ||
using Stove.Domain.Entities.Auditing; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table(nameof(Product))] | ||
public class Product : AggregateRoot, ICreationAudited | ||
[Table("Product")] | ||
public class Product : Entity | ||
{ | ||
[Required] | ||
public virtual string Name { get; set; } | ||
private Product() | ||
{ | ||
_productCategories = new List<ProductCategory>(); | ||
} | ||
|
||
[Required] | ||
public virtual string Code { get; set; } | ||
[NotNull] | ||
public virtual string Name { get; protected set; } | ||
|
||
[Required] | ||
public virtual string Description { get; set; } | ||
[NotNull] | ||
[InverseProperty("Product")] | ||
public virtual ProductBrand ProductBrand { get; protected set; } | ||
|
||
public ProductDetail ProductDetail { get; set; } | ||
[NotNull] | ||
[InverseProperty("Product")] | ||
public virtual ProductGender ProductGender { get; protected set; } | ||
|
||
[Required] | ||
public virtual DateTime CreationTime { get; set; } | ||
[NotNull] | ||
[InverseProperty("Product")] | ||
public virtual ProductDetail ProductDetail { get; protected set; } | ||
|
||
[NotNull] | ||
[ForeignKey("ProductId")] | ||
public IReadOnlyCollection<ProductCategory> ProductCategories => _productCategories.ToImmutableList(); | ||
|
||
public virtual long? CreatorUserId { get; set; } | ||
[NotNull] | ||
protected virtual ICollection<ProductCategory> _productCategories { get; set; } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
test/Stove.Tests.SampleApplication/Domain/Entities/ProductBrand.cs
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("ProductBrand")] | ||
public class ProductBrand : Entity | ||
{ | ||
private ProductBrand() | ||
{ | ||
} | ||
|
||
[NotNull] | ||
[Required] | ||
public virtual Product Product { get; protected set; } | ||
public int ProductId { get; [UsedImplicitly] private set; } | ||
|
||
[NotNull] | ||
[Required] | ||
public virtual Brand Brand { get; protected set; } | ||
public int BrandId { get; [UsedImplicitly] private set; } | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
test/Stove.Tests.SampleApplication/Domain/Entities/ProductCategory.cs
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("ProductCategory")] | ||
public class ProductCategory : Entity | ||
{ | ||
private ProductCategory() | ||
{ | ||
} | ||
|
||
[Required] | ||
public virtual Category Category { get; protected set; } | ||
|
||
[Required] | ||
public virtual Product Product { get; protected set; } | ||
} | ||
} |
16 changes: 13 additions & 3 deletions
16
test/Stove.Tests.SampleApplication/Domain/Entities/ProductDetail.cs
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,26 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table(nameof(ProductDetail))] | ||
[Table("ProductDetail")] | ||
public class ProductDetail : Entity | ||
{ | ||
private ProductDetail() | ||
{ | ||
} | ||
|
||
[Required] | ||
public Product Product { get; set; } | ||
[NotNull] | ||
public virtual string Description { get; protected set; } | ||
|
||
public virtual string Age { get; set; } | ||
[Required] | ||
[NotNull] | ||
public virtual Product Product { get; protected set; } | ||
public int ProductId { get; [UsedImplicitly] private set; } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
test/Stove.Tests.SampleApplication/Domain/Entities/ProductGender.cs
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Stove.Domain.Entities; | ||
|
||
namespace Stove.Tests.SampleApplication.Domain.Entities | ||
{ | ||
[Table("ProductGender")] | ||
public class ProductGender : Entity | ||
{ | ||
private ProductGender() | ||
{ | ||
} | ||
|
||
[Required] | ||
[NotNull] | ||
public virtual Gender Gender { get; protected set; } | ||
public int GenderId { get; [UsedImplicitly] private set; } | ||
|
||
[Required] | ||
[NotNull] | ||
public virtual Product Product { get; protected set; } | ||
public int ProductId { get; [UsedImplicitly] private set; } | ||
} | ||
} |
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