标签云

微信群

扫码加入我们

WeChat QR Code


What is e => e.BooleanProperty? Entities do not have a BooleanProperty member. I've never seen this before...

2018年09月26日52分51秒

Hmm, you'll notice that in my code, I said that table.Context.SubmitChanges() didn't work because it's get-only. Apparently I made a mistake.

2018年09月25日52分51秒

One last question (thanks for your help, by the way!). What is the benefit of using Expression<Func<TEntity,bool>> of just Func<TEntity,bool>? I see to recall something about "compiled expressions." When should I wrap a Func<> in an Expression<>, and can Action<>s be wrapped too?

2018年09月25日52分51秒

If you use Expression, it'll be converted to SQL and executed in the database. A naked Func can load the whole table into memory. Any delegate type can be used for an Expression< T>.

2018年09月26日52分51秒

Does this not create a race condition? Something else could change the database after the Any() and before the SubmitChanges() call?

2018年09月26日52分51秒

A better design might be for the method to be called InsertOnSubmitIfNotExists() and to leave out table.Context.SubmitChanges()

2018年09月25日52分51秒