public IActionResult GetByName(string name) { var colors = ColorsRepository.Get(); var response = colors.Where(x => x.Name.ToLower() == name.ToLower()).FirstOrDefault(); return(Ok(response)); }
public UnitOfWork(WebStoreContext context) { this.context = context; Products = new ProductsRepository(context); Sliders = new SlidersRepository(context); FooterMenus = new FooterMenusRepository(context); HeadingMenus = new HeadingMenusRepository(context); Polls = new PollsRepository(context); Prices = new PricesRepository(context); ProductVariant = new ProductVariantsRepository(context); Colors = new ColorsRepository(context); Votes = new VotesRepository(context); Options = new OptionsRepository(context); Ratings = new RatingsRepository(context); Ordered = new OrderedRepository(context); Orders = new OrdersRepository(context); }
public IActionResult GetAllColors() { var colors = ColorsRepository.Get(); return(Ok(colors)); }