public Good(GoodViewModel good) { GoodId = good.GoodId; GoodName = good.GoodName; GoodCount = good.GoodCount; Price = good.Price; CategoryId = good.CategoryId; ManufacturerId = good.ManufactureId; }
public GoodViewModel(GoodViewModel t, IRepository <Category> repoCat, IRepository <Manufacturer> repoManuf) { Image = t.Image; GoodName = t.GoodName; GoodId = t.GoodId; GoodCount = t.GoodCount; Price = t.Price; CategoryId = t.CategoryId; //ManufactureId = t.ManufacturerId; Categories = new SelectList(new CategoryRepository().GetAll(), "CategoryId", "CategoryName", null); Manufacture = new SelectList(new ManufactureRepository().GetAll(), "ManufacturerId", "ManufacturerName", null); AllCategories = repoCat.GetAll(); AllManufactures = repoManuf.GetAll(); }