/// <summary> /// Allows Service layer objects to be translated into /// UI objects /// </summary> /// <param name="cust">Service layer object</param> /// <returns>UI layer object</returns> public static ProductModel ProductToProductModel(Product product) { ProductModel productModel = new ProductModel(); productModel.ProductId = product.ProductId; productModel.ProductName = product.ProductName; productModel.ProductPrice = product.ProductPrice; return productModel; }
/// <summary> /// Yapıcı metod. Her yeni Ürün ViewModel nesnesi oluşturulduğunda çalışır. /// </summary> public ProductViewModel() { _product = new ProductModel(1,"Macbook Pro","i5 işlemcili Macbook Pro",3400); UpdateCommand = new ProductUpdateCommand(this); DeleteCommand = new ProductDeleteCommand(this); }