This project is read-only.

Set a null value to EntityKey

Aug 3, 2011 at 9:32 PM

How i set a null value to EntityKey

I'm trying with this code without success

 items.Where(x => x.Profile_Information.UserName == UserName).Set(x => x.Profile_InformationReference.EntityKey, null).Update();

thanks

Aug 7, 2011 at 8:37 PM

It's a compilation error? maybe you can cast null to the EntityKey type or use default(type) instead. Also, EntityKey type is nullable, right?

For example, if EntityKey is int?

items.Where(x => x.Profile_Information.UserName == UserName).Set(x => x.Profile_InformationReference.EntityKey, default(int?)).Update();

ort

items.Where(x => x.Profile_Information.UserName == UserName).Set(x => x.Profile_InformationReference.EntityKey, (int?)null).Update();

Cheers,

Ivo