public void AddStoreToOrder(Domain.Models.CurrentOrder order) { _logger.LogInformation("Updating current order with store info of store #{StoreId}", order.StoreId); Entities.CurrentOrder currentEntity = _dbContext.CurrentOrder.First(); //currentEntity.CustomerName = order.CustomerName; //currentEntity.CustomerId = order.CustomerId; currentEntity.Location = order.Location; currentEntity.StoreId = order.StoreId; _dbContext.SaveChanges(); }
public void BeginOrder(Domain.Models.CurrentOrder order) { _logger.LogInformation("Starting order."); Entities.CurrentOrder newEntity = new Entities.CurrentOrder { CustomerName = order.CustomerName, CustomerId = order.CustomerId, TotalPrice = 0 }; _dbContext.CurrentOrder.Add(newEntity); }
public Domain.Models.CurrentOrder GetCurrentOrder() { Entities.CurrentOrder order = _dbContext.CurrentOrder.First(); Domain.Models.CurrentOrder newEntity = new Domain.Models.CurrentOrder { Id = order.Id, CustomerName = order.CustomerName, CustomerId = order.CustomerId, Location = order.Location, StoreId = order.StoreId, Order = order.Order, TotalPrice = order.TotalPrice }; return(newEntity); }