Discussions

Ask a Question
Back to All

EntityManager Find vs FindByIdentity performance

Hello all,

In order to retrieve PartyCommercePreferences for user we are using following code:

PartyCommercePreferencesData partyCommPreferences = EntityManager.FindByIdentity(new IdentityData(typeof(PartyCommercePreferencesData), UserID)) as PartyCommercePreferencesData;

Sample code from iMIS SDK uses following code:
var findResultsData = entityManager.Find(new QueryData(PartyCommercePreferencesData.EntityTypeName).AddCriteria(new CriteriaData("PartyId", OperationData.Equal, UserID))).Result;
PartyCommercePreferencesData partyCommPreferences = findResultsData[0] as PartyCommercePreferencesData;

Is there some performance penalty by using FindByIdentity and/what would be other advantages (or disadvantages) using EntityManager.Find

Thanks,
Igor