public IActionResult ViewWShop(string wshopName) { //var wshopVM = new WShopVM { WShopName = wshopName }; WShop wshop = repo.GetWShopByName(wshopName); return(View(wshop)); }
public IActionResult CreateWShop(WShop model) { model.Owner = userManager.GetUserAsync(User).Result; //model.TownLocation = userManager.GetUserAsync(User).Result.TownResidence; repo.AddWShop(model); return(RedirectToAction("Index", "WTown")); }
public void GetByOwnerTest() { var fakeRepo = new FakeRepo(); var wshop = new WShop() { WShopName = "Name", Owner = new WCitizen() { Name = "John", UserName = "******" } }; fakeRepo.AddWShop(wshop); var retrievedWShop = fakeRepo.GetWShopByOwner("John"); Assert.Equal(0, wshop.WShopName.CompareTo(retrievedWShop.WShopName)); }
public void AddWShopTest() { var fakeRepo = new FakeRepo(); var wshop = new WShop() { WShopName = "Name", Owner = new WCitizen() { Name = "John", UserName = "******" } }; fakeRepo.AddWShop(wshop); var retrievedWShop = fakeRepo.wshops.ToList()[0]; Assert.Equal(0, wshop.WShopName.CompareTo(retrievedWShop.WShopName)); }
public void UpdateWShop(WShop wshop) { context.WShops.Update(wshop); context.SaveChanges(); }
public void AddWShop(WShop wshop) { context.WShops.Add(wshop); context.SaveChanges(); }
public void UpdateWShop(WShop wshop) { throw new NotImplementedException(); }
public void AddWShop(WShop wshop) { wshops.Add(wshop); }