/// <summary> /// Adds a new order to the database. /// </summary> /// <param name="o">The order to be added</param> /// <param name="orderContext">DB Context</param> /// <returns></returns> public static async Task <Order> Add(Order o, OrderContext orderContext) { return(await OrderAction(o, orderContext, EntityState.Added)); }
/// <summary> /// Edits an existing Order entry in the database. /// </summary> /// <param name="o">The order to be edited</param> /// <param name="orderContext">DB Context</param> /// <returns></returns> public static async Task <Order> Edit(Order o, OrderContext orderContext) { return(await OrderAction(o, orderContext, EntityState.Modified)); }
/// <summary> /// Returns the total number of Order items /// </summary> /// <param name="orderContext">DB Context</param> public async static Task <int> GetNumOrders(OrderContext orderContext) { return(await orderContext.Orders.CountAsync()); }