Exemplo n.º 1
0
        public async Task <IActionResult> Index(string SearchString)
        {
            SportsApparelContext sportsApparelContext = new SportsApparelContext();

            var customers = from m in sportsApparelContext.Customer
                            select m;

            if (!String.IsNullOrEmpty(SearchString))
            {
                customers = customers.Where(s => s.FirstName.Contains(SearchString) || s.LastName.Contains(SearchString));
            }

            return(View(await customers.ToListAsync()));
        }
 public CustomerRepo(SportsApparelContext contextStores, ILogger <CustomerRepo> logger)
 {
     _contextStores = contextStores ?? throw new ArgumentNullException(nameof(contextStores));
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public CustomerRepo()
 {
     _contextStores = new SportsApparelContext();
 }
Exemplo n.º 4
0
 public StoreRepo()
 {
     _contextStores = new SportsApparelContext();
 }
Exemplo n.º 5
0
 public PlaceOrderRepo()
 {
     sportsApparelContext = new SportsApparelContext();
 }
Exemplo n.º 6
0
 public ShopController()
 {
     context = new SportsApparelContext();
 }
Exemplo n.º 7
0
 public ProductRepo()
 {
     _contextStores = new SportsApparelContext();
 }