Have a Snippet?

Keep, track and share your code snippets with your friends



C#: Update record using EF Share on Vkontakte

Update record in database using entity framework

                      try
            {
                using (var context = new myEntities())
                {
                    var document = context.ORDERS.Single(parameter => parameter.ID_ORDER == idOrder);
                    document.ORDER_STATUS = status;
                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {

                Logger.TraceError(ex.Message);
            }


Tag: entity framework, database, C#

0 Comments