public byte GenerateNewCategoryId() { byte categoryId; try { var newCategoryId = (from p in _context.Categories select QuickKartDBContext.ufn_GenerateNewCategoryId()).FirstOrDefault(); categoryId = Convert.ToByte(newCategoryId); } catch (Exception ex) { categoryId = 0; } return(categoryId); }
public string GenerateNewProductId() { string productId; try { productId = (from p in _context.Products select QuickKartDBContext.ufn_GenerateNewProductId()).FirstOrDefault(); } catch (Exception) { productId = null; } return(productId); }
public QuickKartRepository() { context = new QuickKartDBContext(); }
public QuickKartRepository(QuickKartDBContext context) { _context = context; }