Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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());
 }