public static int GetId(ClothesTypes itemChoise, ClothesContext db) { while (true) { try { Console.Write("Enter item's Id: "); var id = Convert.ToInt32(Console.ReadLine()); if ((db.Tops.Find(id) == null && itemChoise == ClothesTypes.Tops) || (db.Pants.Find(id) == null && itemChoise == ClothesTypes.Pants) || (db.Shoes.Find(id) == null && itemChoise == ClothesTypes.Shoes)) { Misc.ConsoleLog(ConsoleColor.Yellow, $"Sorry, there is no {itemChoise} in DataBase with such ID, exit (Y/N)?"); string temp = Console.ReadLine(); if (temp == "Y" || temp == "y") { return(-1); } } else { return(id); } } catch (Exception) { Misc.ConsoleLog(ConsoleColor.Yellow, "Incorrect Id, try again"); } } }
public SqlInventoryRepo(ClothesContext context) { _context = context; }
public ClothesRepository(ClothesContext clothesContext) { this.clothesContext = clothesContext; }
public ProductImagesRepository(ClothesContext context) : base(context) { }
public DepartmentRepository(ClothesContext context) : base(context) { }
public ClothingRepository(ClothesContext clothesContext) { ClothesContext = clothesContext; }
public UnitOfWork(ClothesContext context) { Context = context; }
public Repository(ClothesContext context) { Context = context; }
public AppUserRepository(ClothesContext context) : base(context) { }
public OwnerRepository(ClothesContext context) : base(context) { }
public HomeController(ClothesContext context) { db = context; Console.WriteLine(db); }