UpdateMulti bug

Posts   
 
    
paulshealy
User
Posts: 22
Joined: 13-Jun-2005
# Posted on: 14-Sep-2007 21:16:50   

I'm using the latest version of LLBLGenPro - 2.5, built Aug 28. Doing an UpdateMulti like this


LPTEventEntity e = new LPTEventEntity ();
e.Volume = 0;
IRelationCollection relations = new RelationCollection ();
relations.Add (LPTEventEntity.Relations.LPTAreaEntityUsingAreaId);
new LPTEventCollection ().UpdateMulti (e, (LPTEventFields.Date == date) & (LPTAreaFields.HotelID == hotelId), relations);

Throws a NullReference exception from DaoBase.UpdateMulti(IEntity entityWithNewValues, ITransaction containingTransaction, IPredicate updateFilter, IRelationCollection relations). We build LLBLGen from source, so I've already found the bug:


IRelationCollection relationsToUse = null;

if(typeOfHierarchy == InheritanceHierarchyType.TargetPerEntity)
{
    IInheritanceInfo info = ((EntityBase)entityWithNewValues).GetInheritanceInfo();
    relationsToUse = new RelationCollection();
    relationsToUse.AddRange(info.RelationsToHierarchyRoot);
}
if(relations != null)
{
    relationsToUse.AddRange((RelationCollection)relations);
}

'relationsToUse' is never set.

I've fixed it for us; this is an FYI.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Sep-2007 02:54:20   

Confirmed. Thanks for the feedback. We'll look into it.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 15-Sep-2007 12:11:01   

Fixed in next build.

Frans Bouma | Lead developer LLBLGen Pro