Ejemplo n.º 1
0
 public Payload BuildPayload(string schemaId, List<object> objects)
 {
     var schema = _config.Schemas.First(s => s.Id == schemaId);
     var columns = schema.Parameters.Select(p => p.Name).ToList();
     var payload = new Payload
     {
         Schema = schemaId,
         Data = new DataList
         {
             Columns = columns,
             Records = new List<DataRecord>
                 {
                    new DataRecord 
                    {
                        Values = objects
                    } 
                 }
         }
     };
     return payload;
 }
Ejemplo n.º 2
0
 public Request BuildRequest(Payload payload, string tag, string token, string userId)
 {
     return new Request {CreatedDate = DateTime.Now, Id = Guid.NewGuid(), Machine = Environment.MachineName, Payload = payload, Tag = tag, Token = token, UserId = userId};
 }