This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Due to a complexity with our database design we have a foreighn key relationship that is 'nullable'. Is this behaviour supported, one of the developers here had a go by passing null to the entity holder property but that caused problems, we have got around the issue by explicitly setting (or not setting) the id property which is a nullable int. public class Centre {private int? _geoCodeId; [ ReverseAssociation("Centres")]private readonly EntityHolder<GeoCode> _geoCode = new EntityHolder<GeoCode>();public GeoCode GeoCode { get { return Get(_geoCode); } set { Set(_geoCode, value); } } public int? GeoCodeId { get { return _geoCodeId; } set { Set(ref _geoCodeId, value); } } } usage GeoCode geoCode = null;...geoCode = unitOfWork.FindOne<GeoCode>(Entity.Attribute("Postcode") == row.postcode); if (geoCode != null) centre.GeoCodeId = geoCode.Id;Desired centre.GeoCode = geoCode; // where geoCode could be null Cheers, Nick |
|
|
Hi Nick, These are completely supported and you should have no problem setting the property to null. Can you be more precise as to the issue you encountered? Cheers, Andrew. |
|