Example #1
0
 public PipelineContext(
     IPipelineLogger logger,
     Process process,
     Entity entity = null,
     Field field = null,
     Transform transform = null
 ) {
     ForLog = new object[5];
     Logger = logger;
     Activity = PipelineActivity.Transform;
     Process = process;
     Entity = entity ?? process.GetValidatedOf<Entity>(e => { e.Name = string.Empty; });
     Field = field ?? process.GetValidatedOf<Field>(f => { f.Name = string.Empty; });
     Transform = transform ?? process.GetDefaultOf<Transform>(t => { t.Method = string.Empty; });
     ForLog[0] = process.Name.PadRight(process.LogLimit, ' ').Left(process.LogLimit);
     ForLog[1] = Entity.Alias.PadRight(process.EntityLogLimit, ' ').Left(process.EntityLogLimit);
     ForLog[2] = ' ';
     ForLog[3] = Field.Alias.PadRight(process.FieldLogLimit, ' ').Left(process.FieldLogLimit);
     ForLog[4] = Transform.Method.PadRight(process.TransformLogLimit, ' ').Left(process.TransformLogLimit);
 }
Example #2
0
 private static Entity GetTestEntity() {
     var process = new Process();
     return process.GetValidatedOf<Entity>(e => {
         e.Name = "e1";
         e.Delete = true;
         e.Fields = new List<Field> {
         process.GetValidatedOf<Field>(f => {
             f.Index = 0;
             f.Name = "f1";
             f.Type = "int";
             f.PrimaryKey = true;
         }),
         process.GetValidatedOf<Field>(f => {
             f.Index = 1;
             f.Name = "f2";
             f.Type = "string";
             f.Length = "64";
         })
     };
     });
 }