I want to implement this while doing fetch. so when i am sending request by FetchEntityCollection, i dont have anything to loop as this is new collection and i want to implement authorizer while doing fetch. Your answer is valuable.
e.g.
Dim employeeEntityCollection As New Grb.Framework.Business.Lower.HelperClasses.EntityCollection(Of Grb.Framework.Business.Lower.EntityClasses.EmpGeneralEntity)
Dim filter As New SD.LLBLGen.Pro.ORMSupportClasses.RelationPredicateBucket()
Dim predicateExpression As New SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression()
predicateExpression.Add(Grb.Framework.Business.Lower.HelperClasses.EmpGeneralFields.Ssn = ssn)
predicateExpression.Add(Grb.Framework.Business.Lower.HelperClasses.EmpGeneralFields.DomainId = domainId)
filter.PredicateExpression.Add(predicateExpression)
externalAdapter.FetchEntityCollection(employeeEntityCollection, filter, employeePreFetchPath)
Walaa wrote:
This is per entity, as it's an entity property.
You'll have to loop on the entities and set it one by one.
Also you may do the following:
By overriding the Entity method CreateAuthorizer. This is a protected virtual (Protected Overridable) method which by default returns null / Nothing. You can override this method in a partial class or user code region of the Entity class to create the Authorizer to use for the entity. The LLBLGen Pro runtime framework will take care of calling the method. One way to create an override for most entities is by using a template. Please see the LLBLGen Pro SDK documentation for details about how to write templates to generate additional code into entities and in separate files. Also please see Adding Adding your own code to the generated classes for details.
This will guarantee any created entity will have the oroperty set. (without using DI)