When I use the method in Migration class like this:
DbSet<T>.AddOrUpdate( new Instance(){});
the method just generate insert T-SQL, and I receive one exception, because The row has exists in the table.
the slibing method in Migration class like this:
DbSet<T>.AddOrUpdate( p=>p.name,new Instance(){}):
I can't transform this in my fashion( the table has one join index(Column1,Column2)).
now my question is: how to use the Method
public static void AddOrUpdate<TEntity>(
this IDbSet<TEntity> set,
Expression<Func<TEntity, Object>> identifierExpression,
params TEntity[] entities
)where TEntity : class
the parameter identifierExpression I must defined tow column of the table to determine whether an Add or Update operation should be performed
using this statement will resolve in a problem, because it cannot index your columns.
Should you use this instead: