Beispiel #1
0
 public ProductsDto(Core.Domain.Entities.Products entity)
 {
     ProductId     = entity.ProductId;
     ProductName   = entity.ProductName;
     BrandId       = entity.BrandId;
     BrandName     = entity.Brand?.BrandName;
     CategoryId    = entity.CategoryId;
     CategorytName = entity.Category?.CategoryName;
     ModelYear     = entity.ModelYear;
     ListPrice     = entity.ListPrice;
 }
Beispiel #2
0
        internal Core.Domain.Entities.Products ToEntity(Core.Domain.Entities.Products entity, ActionType action)
        {
            if (action == ActionType.Update)
            {
                entity.Brand    = null;
                entity.Category = null;
            }

            entity.ProductId   = ProductId.HasValue ? ProductId.Value : 0;
            entity.ProductName = ProductName;
            entity.CategoryId  = CategoryId;
            entity.BrandId     = BrandId;
            entity.ModelYear   = ModelYear;
            entity.ListPrice   = ListPrice;
            return(entity);
        }
 internal Core.Domain.Entities.Products ToProductEntity(Core.Domain.Entities.Products entity)
 {
     entity.ListPrice = ListPrice;
     return(entity);
 }