Solution:
try {
context.SaveChanges();
} catch (OptimisticConcurrencyException) {
context.Refresh(RefreshMode.ClientWins, db.Articles);
context.SaveChanges();
}
More Related Contents:
- The object ‘DF__*’ is dependent on column ‘*’ – Changing int to double
- How to Create a real one-to-one relationship in SQL Server
- Create Trigger to log SQL that affected table?
- How do I use structural annotations to set SQL type to Date in model first approach
- Need to list all triggers in SQL Server database with table name and table’s schema
- How can I do a BEFORE UPDATED trigger with sql server?
- SQL Server Update Trigger, Get Only modified fields
- How do I prevent a database trigger from recursing?
- Sql Server trigger insert values from new row into another table
- SQL update trigger only when column is modified
- Can anyone help me to get the query to retrieve data like below [closed]
- Simple way to transpose columns and rows in SQL?
- Optimal way to concatenate/aggregate strings
- How can I delete using INNER JOIN with SQL Server?
- Maximum size for a SQL Server Query? IN clause? Is there a Better Approach [duplicate]
- Convert varchar into datetime in SQL Server
- TSQL Pivot without aggregate function
- Fastest way to perform nested bulk inserts with scope_identity() usage?
- SQL performance on LEFT OUTER JOIN vs NOT EXISTS
- Why are there gaps in my IDENTITY column values?
- Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one sql statement
- How to create table using select query in SQL Server?
- join comma delimited data column
- conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- How do I pass a list as a parameter in a stored procedure?
- Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon
- Can you have if-then-else logic in SQL? [duplicate]
- SQL – Call Stored Procedure for each record
- Group All Related Records in Many to Many Relationship, SQL graph connected components
- SQL query to group by day