public string GetAisle() { Random rand = new Random(); int randNum = rand.Next(1, 25); string temp = Manufactuer.ToUpper(); temp = temp[0] + randNum.ToString(); return(temp); }
public ActionResult <Manufactuer> CreateWine(Manufactuer manufactuer) { Address address = _context.Addresses.Find(manufactuer.address.Id); if (address != null) { manufactuer.address = address; } _context.Manufactuers.Add(manufactuer); _context.SaveChanges(); return(CreatedAtRoute(nameof(GetManufactuerById), new { Id = manufactuer.Id }, manufactuer)); }
public ActionResult UpdateManufactuer(int id, Manufactuer manufactuerUpdate) { var manufactuerUnupdate = _context.Manufactuers.FirstOrDefault(w => w.Id == id); if (manufactuerUnupdate != null) { manufactuerUnupdate.Name = manufactuerUpdate.Name; _context.SaveChanges(); return(NoContent()); } else { return(NotFound()); } }