public static ProductEntity ToProductEntity(this ProductprViewModel modelView) { ProductEntity model = new ProductEntity(); //model.Id = modelView.Id; model.Name = modelView.Name; model.Price = modelView.Price; model.ShelfLife = modelView.ShelfLife; model.CountryOfOrigin = modelView.CountryOfOrigin; model.Amount = modelView.AvailableAmount ?? default(int); model.IsReceived = false; return(model); }
public static ProductprViewModel ToProductprViewModel(this ProductprEntity orderEntity) { ProductprViewModel model = new ProductprViewModel(); model.Id = orderEntity.Id; model.Name = orderEntity.Name; model.Parentid = orderEntity.Parentid; model.Price = orderEntity.Price; model.ShelfLife = orderEntity.ShelfLife; model.CountryOfOrigin = orderEntity.CountryOfOrigin; model.AvailableAmount = orderEntity.AvailableAmount; return(model); }