public void UpdateOrder(OrderModel order) { try { using (ApplicationContext db = new ApplicationContext()) { var result = db.Orders.SingleOrDefault(o => o.Id == order.Id); result = order.CloneWithoutId(result); db.SaveChanges(); } } catch (Exception e) { Console.WriteLine(e); throw e; } }