public CreateMethod ( OrmEntity entity ) : OrmEntityMethod | ||
entity | OrmEntity | |
Résultat | OrmEntityMethod |
/// <summary> /// Add a method to the definition for the entity. /// </summary> /// <param name="entity"></param> /// <param name="method"></param> private static void AddMethodToEntity(OrmEntity entity, MethodDescription method) { OrmEntityMethod targetMethod = null; targetMethod = method.CreateMethod(entity); OrmMethodTarget targetStep = method.CreateTarget(AUTOWIRE_HEADER); TargetMethodCollection targetColl = null; switch (method.StepType) { case TargetStepType.PreExecute: targetColl = targetMethod.PreExecuteTargets; break; case TargetStepType.PostFlush: targetColl = targetMethod.PostFlushTargets; break; case TargetStepType.PostExecute: targetColl = targetMethod.PostExecuteTargets; break; case TargetStepType.Primary: default: targetColl = targetMethod.MethodTargets; break; } targetColl.Add(targetStep); entity.Methods.Add(targetMethod); }
/// <summary> /// Add a method to the definition for the entity. /// </summary> /// <param name="entity"></param> /// <param name="method"></param> private static void AddMethodToEntity(OrmEntity entity, MethodDescription method) { OrmEntityMethod targetMethod = null; targetMethod = method.CreateMethod(entity); OrmMethodTarget targetStep = method.CreateTarget(AUTOWIRE_HEADER); TargetMethodCollection targetColl = null; switch (method.StepType) { case TargetStepType.PreExecute: targetColl = targetMethod.PreExecuteTargets; break; case TargetStepType.PostFlush: targetColl = targetMethod.PostFlushTargets; break; case TargetStepType.PostExecute: targetColl = targetMethod.PostExecuteTargets; break; case TargetStepType.Primary: default: targetColl = targetMethod.MethodTargets; break; } targetColl.Add(targetStep); entity.Methods.Add(targetMethod); }