public static List <DTO.OrderDTO> GetOrders() { var db = new CalendarAppDbEntities(); var orders = db.Bookings.ToList(); var orderDTO = ConvertToDTO(orders); return(orderDTO); }
public static void CreateOrder(OrderDTO orderDTO) { var db = new CalendarAppDbEntities(); var order = ConvertToEntity(orderDTO); db.Bookings.Add(order); db.SaveChanges(); }