コード例 #1
0
 public HateoasTestData(string routeName, string controller, string method,
                        Dictionary <string, object> routeValues = null, string customTemplate = null)
 {
     RouteName      = routeName;
     ControllerName = controller;
     Method         = method;
     RouteValues    = routeValues ?? new Dictionary <string, object>();
     if (RouteValues.Count > 0)
     {
         var pair = RouteValues.First();
         Template = customTemplate ?? $"{{{pair.Key}}}";
         _value   = pair.Value;
     }
     else
     {
         Template = "";
         _value   = null;
     }
 }