35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
namespace Netina.Domain.Entities.Brands;
|
|
|
|
public partial class Brand
|
|
{
|
|
public static Brand Create(string persianName, string englishName, string description, bool hasSpecialPage, string pageUrl)
|
|
{
|
|
|
|
var slug = StringExtensions.GetSlug(persianName);
|
|
return new Brand(persianName, slug, englishName, description, hasSpecialPage, pageUrl);
|
|
}
|
|
|
|
public void AddMetaTag(string key, string value)
|
|
=> MetaTags.Add(BrandMetaTag.Create(key, value, Id));
|
|
|
|
public BrandStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
|
|
{
|
|
var file = BrandStorageFile.Create(name, fileLocation, fileName, isHeader, isPrimary, fileType, this.Id);
|
|
Files.Add(file);
|
|
return file;
|
|
}
|
|
}
|
|
|
|
public partial class BrandMetaTag
|
|
{
|
|
public static BrandMetaTag Create(string key, string value, Guid brandId)
|
|
=> new (key, value, brandId);
|
|
}
|
|
|
|
public partial class BrandStorageFile
|
|
{
|
|
public static BrandStorageFile Create(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType, Guid brandId)
|
|
{
|
|
return new BrandStorageFile(name, fileLocation, fileName, isHeader, isPrimary, fileType, brandId);
|
|
}
|
|
} |