/// <summary> /// Adds a product to the data store /// </summary> /// <param name="p"></param> /// <returns></returns> public Task AddProductAsync(Product p) { _context.Add(p); // If you dont await this it will return as Task // In this case we want it to return as Task return(_context.SaveChangesAsync()); }
/// <summary> /// Adds a product to the data store /// </summary> /// <param name="p"></param> /// <returns></returns> public Task AddProductAsync(Product p) { _context.Add(p); return(_context.SaveChangesAsync()); //throw new NotImplementedException(); }
/// <summary> /// Adds a product to the data store. /// </summary> /// <param name="p"></param> /// <returns></returns> public Task AddProductAsync(Product p) { _context.Add(p); return(_context.SaveChangesAsync()); }