Converting from 1.1 to 2.0 Questions

Posts   
 
    
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 23-Apr-2009 22:04:21   

I am upgrading my 1.0.2004 llblgen code to 2.6 and before I change all of my signatures in my code to use the EntityCollection<ttype> instead of the plain old EntityCollection I'm using now for passing in an entity collection, what is the recommendation of the llblgen developers? Not being a C# guru, could you tell me if I'm better off to use the generic or non generic collections. It looks like I'll need to change my signatures either way, so I just would like an opinion. Example is snippet calling FindCompanyPropertyEntityMatchingPeriod which takes a CompanyPropertyEntity collection.

    
CompanyPropertyEntity matchingCompanyPropertyEntity = FindCompanyPropertyEntityMatchingPeriod(companyEntity.CompanyProperty);

            // If no matches are found then return default 
            if (matchingCompanyPropertyEntity == null)
            {
                throw new ArgumentOutOfRangeException(string.Empty, "Effective Filing Period not found");

            }

// current signature 

  private CompanyPropertyEntity FindCompanyPropertyEntityMatchingPeriod(EntityCollection companyPropertyEntityCollection) 
        {
            .... some more code 
            return defaultCompanyPropertyEntity; // Match was not found, return default
        }


        
Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 24-Apr-2009 10:55:56   

Better to use the generic collections. The entities themselves use the generic variant, so CustomerEntity.Orders will be of type EntityCollection(Of OrderEntity).