public IEnumerable<Product> GetProductsNotInGroceries(IGroceryRepository repo) { List<Product> selectedProducts; if (!repo.GetGroceries().Any()) { selectedProducts = repo.GetProducts().ToList(); } else { var groceries = repo.GetGroceries().Select(p => p.ProductId).ToArray(); var products = repo.GetProducts().Select(p => p.Id).ToArray(); var unselected = products.Except(groceries); selectedProducts = repo.GetProducts().Where(p => unselected.Contains(p.Id)).ToList(); } return selectedProducts; }
public GroceryService(IGroceryRepository groceryItemRepository) { this.groceryItemRepository = groceryItemRepository; }
public GroceryService(IMapper mapper, IGroceryRepository groceryRepository) { _mapper = mapper; _groceryRepository = groceryRepository; }
public GroceriesHub(IGroceryRepository groceryRepository) { _groceryRepository = groceryRepository; }
public ProductsController(IGroceryRepository groceryRepository, IGroceryService groceryService ) { _groceryRepository = groceryRepository; _groceryService = groceryService; }
public GroceryHub() { _groceryRepository = new GroceryRepository(); }
public GroceriesController() { _groceryRepository = new GroceryRepository(); }
private GroceryService() { GroceryRepository = new GroceryRepository <GroceryItemModel>(new GroceryDatabaseEntities()); }
public GroceriesController(IGroceryRepository groceryRepository) { _groceryRepository = groceryRepository; }
public ProductController(IGroceryRepository repo) { repository = repo; }
public AccountController(IGroceryRepository repo) { repository = repo; }
public GroceryServices(IGroceryRepository groceryRepository) { _groceryRepository = groceryRepository; }
public GroceryController(IGroceryRepository repository) { _repository = repository; }
public CurrentCartController(IGroceryRepository repo) { repository = repo; }
public NavigationMenuViewComponent(IGroceryRepository repo) { repository = repo; }
public CategoryController(IGroceryRepository repo) { repository = repo; }
/// <summary> /// /// </summary> /// <param name="logger"></param> /// <param name="principal"></param> /// <param name="iGroceryRepository"></param> public GroceryService(ILogger <GroceryService> logger, IPrincipal principal, IGroceryRepository iGroceryRepository) { _logger = logger; _principal = principal as ClaimsPrincipal; _groceryRepository = iGroceryRepository; }
public AdminController(IGroceryRepository repo) { repository = repo; }
public OrderController(IGroceryRepository repoServise, CurrentCart cartService) { repository = repoServise; cart = cartService; }
public GroceriesController(IGroceryRepository groceryRepository) { _groceryRepository = groceryRepository; }
public GroceryService() { var context = new GroceryContext(); this.GroceryRepository = new GroceryRepository(context); }