Exemplo 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);
     }
 }
Exemplo 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
                }));
            }