This commit is contained in:
@@ -147,25 +147,21 @@ public static class Mappers
|
||||
Enabled = entity.Enabled
|
||||
};
|
||||
|
||||
public static Product ToModel(this Products.Entities.Product entity)
|
||||
public static Product ToModel(this Products.Entities.Product entity) => new Product
|
||||
{
|
||||
return new Product
|
||||
{
|
||||
Id = entity.Id,
|
||||
CreatedAt = entity.CreatedAt,
|
||||
UpdatedAt = entity.UpdatedAt,
|
||||
Name = entity.Name,
|
||||
Summary = entity.Summary,
|
||||
Description = entity.Description,
|
||||
Type = entity.Type,
|
||||
ImageUrl = entity.ImageUrl,
|
||||
ThumbnailUrls = entity.ThumbnailUrls,
|
||||
Metadata = entity.Metadata,
|
||||
Categories = entity.Categories,
|
||||
Enabled = entity.Enabled,
|
||||
Price = entity.Prices?.FirstOrDefault(p => p.Enabled)?.ToModel() ?? null,
|
||||
};
|
||||
}
|
||||
Id = entity.Id,
|
||||
CreatedAt = entity.CreatedAt,
|
||||
UpdatedAt = entity.UpdatedAt,
|
||||
Name = entity.Name,
|
||||
Summary = entity.Summary,
|
||||
Description = entity.Description,
|
||||
Type = entity.Type,
|
||||
ImageUrl = entity.ImageUrl,
|
||||
ThumbnailUrls = entity.ThumbnailUrls,
|
||||
Metadata = entity.Metadata,
|
||||
Enabled = entity.Enabled,
|
||||
Price = entity.Prices?.FirstOrDefault(p => p.Enabled)?.ToModel() ?? null,
|
||||
};
|
||||
|
||||
public static Author ToModel(this Authors.Entities.Author entity) => new()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user