Esempio n. 1
0
 static void SetPatternValuesToCommand(CqrsEndpointsBuilder.EndpointResult endpointResult, Command command)
 {
     foreach (var patternSegmentObject in endpointResult.PatternSegmentObjects)
     {
         endpointResult.Type.GetProperty(patternSegmentObject.Key).SetValue(command, patternSegmentObject.Value);
     }
 }
Esempio n. 2
0
            static Command GetCommand(CqrsEndpointsBuilder.EndpointResult endpointResult, string request)
            {
                if (string.IsNullOrEmpty(request))
                {
                    return((Command)Activator.CreateInstance(endpointResult.Type));
                }

                return((Command)JsonSerializer.Deserialize(request, endpointResult.Type, new JsonSerializerOptions {
                    PropertyNamingPolicy = JsonNamingPolicy.CamelCase
                }));
            }