Пример #1
0
 /// <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));
 }
Пример #2
0
 /// <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));
 }
Пример #3
0
 /// <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());
 }