public BarberShop Create(BarberShop model) { _ctx.BarberShops.Add(model); _ctx.SaveChanges(); return(model); }
public ReviewsM() { Reviews = new ObservableCollection <ReviewItem>(); barberShop = DataBaseConnector.GetBarberShop(); LoadList(); Info = "None"; }
void Start() { barbershopScript = GameObject.Find("MainController").GetComponent <BarberShop>(); barberChairScript = GameObject.Find("barberChair").GetComponent <Chair>(); barberScript = this.GetComponent <Barber>(); toggleAwake = GameObject.Find("ToggleAwake").GetComponent <Toggle>(); sleep(); }
private static void SleepingBarber() { Console.WriteLine("--- Sleeping Barber ---"); var barberShop = new BarberShop(3); barberShop.StartWork(); }
// Task 4: Sleeping Barber public static void RunTask4(int maxClientsCount) { var barberShop = new BarberShop(maxClientsCount); var barber = new Barber(barberShop); var client = new Client(barberShop); Task.WaitAll(barber.Run(), client.Run()); }
void Start() { barberShopScript = GameObject.Find("MainController").GetComponent <BarberShop>(); textCustomersValue = GameObject.Find("TextCustomersValue").GetComponent <Text>(); for (int i = 0; i < totalNumberOfCustomers; i++) { Invoke("spawnCustomer", Random.Range(minSpawnTime, maxSpawnTime) * i); // invoke a method after some random time } }
private static void CustomerAsync(BarberShop bs) { bool a = false; int customer = -1; for (int i = 0; i < MaxCustomers; i++) { a = bs.waitOrLeave(i); customer = i; Thread.Sleep(6000); } }
public BarberShop Update(BarberShop model) { var entity = _ctx.BarberShops.FirstOrDefault(x => x.Id == model.Id); entity.Name = model.Name; entity.Address = model.Address; entity.City = model.City; _ctx.SaveChanges(); return(model); }
void Start() { mainController = GameObject.Find("MainController"); barberShopScript = GetComponentInParent <BarberShop>(); if (!mainController) { Debug.LogError("Object MainController not found!"); } if (!barberShopScript) { Debug.LogError("BarberShop script not found in MainController"); } }
void Start() { barberShopScript = GameObject.Find("MainController").GetComponent <BarberShop>(); rb2D = GetComponent <Rigidbody2D>(); reception = GameObject.Find("MainController").transform.FindChild("WaypointReception"); exit = GameObject.Find("MainController").transform.FindChild("WaypointExit"); if (!reception) { Debug.LogError("Waypoint Reception not found as a child of MainController"); } if (!exit) { Debug.LogError("WaypointExit not found as a child of MainController"); } }
private static void BarberAsync(BarberShop bs) { while (true) { while (bs.waitForCustomerArrive()) { Console.WriteLine("a customer arrived"); bs.waitForCustomerInBarberChair(); bs.cutHair(); bs.doneCutting(); } } }
public BarberShopModel GetById(int id) { BarberShop model = _barberShopEFRepository.GetById(id); return(_mapper.Map <BarberShopModel>(model)); }