CustomerMenuController Members

TriCodeTest

CustomerMenuController Members

The CustomerMenuController type exposes the following members.

Constructors


  Name Description
Public method CustomerMenuController
Initializes a new instance of the CustomerMenuController class.

Methods


  Name Description
Private method AddNewOrderToDatabase
Creates a new empty cart if a cart hasn't been created already
Private method CalculateTotalPrice
Calculates total price of order
Public method Cart
Returns a view with the order of the current logged in user
Private method ConvertToOrderMenuItem
Converts item to view model containing choice of addons tha can be added
Public method EditItem(Nullable<(Of <<'(Int32>)>>))
Returns view containing item passed in to be able to edit it
Public method EditItem(CartOrderMenuItem)
Updates the edited item in the database
Private method GetCurrentUserAsync
Gets the current user asynchronous.
Public method Index
Receives all items needed to build the menu from the database and returns them as an object with lists
Private method OrderDeserialize
Deserializes an Order and converts it to the view model
Private method OrderSerialize
Serializes a view model and converts it to an Order
Public method PostMenuItemToCart
Adds single menu item to cart
Public method RemoveItem
Removes passed item from user's cart
Public method SubmitOrder
Submits the order and changes it's status from Cart to Received

Fields


  Name Description
Private field _context
The context
Private field _userManager
The user manager