UseHiLo
This commit is contained in:
@@ -29,14 +29,13 @@ public class Category : Entity<CategoryId>
|
||||
DescriptionVO description,
|
||||
CategoryImage image,
|
||||
CategoryPath path,
|
||||
CategoryId? parentId = null,
|
||||
CategoryPath? parentPath = null)
|
||||
CategoryId? parentId = null)
|
||||
{
|
||||
_title = title;
|
||||
_description = description;
|
||||
_image = image;
|
||||
_parentId = parentId;
|
||||
//_path = CategoryPath.CreatePath(parentPath, ;
|
||||
_path = path;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,10 +43,9 @@ public class Category : Entity<CategoryId>
|
||||
DescriptionVO description,
|
||||
CategoryImage image,
|
||||
CategoryPath path,
|
||||
CategoryId? parentId = null,
|
||||
CategoryPath? parentPath = null)
|
||||
CategoryId? parentId = null)
|
||||
{
|
||||
return new Category(title, description, image, path, parentId, parentPath);
|
||||
return new Category(title, description, image, path, parentId);
|
||||
}
|
||||
|
||||
public TitleVO Title => _title;
|
||||
|
||||
@@ -17,4 +17,10 @@ public class CategoryImage : ValueObject
|
||||
=> new CategoryImage(value);
|
||||
|
||||
public string Value { get; init; }
|
||||
|
||||
public static implicit operator CategoryImage?(string? value)
|
||||
=> string.IsNullOrWhiteSpace(value) ? null : new(value);
|
||||
|
||||
public static implicit operator string(CategoryImage value)
|
||||
=> value.Value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user