示例#1
0
        private static HalForm GetMoioForm()
        {
            var defaultTemplate = new DefaultTemplate();

             defaultTemplate.Title = "Moio moddervokkers";
             defaultTemplate.Method = HttpMethod.Post;

             var property = new Property("name")
             {
            Prompt = "What's your name moddervokker (duh)",
            Required = true
             };
             defaultTemplate.AddProperty(property);

             property = new Property("age")
             {
            Prompt = "How old are you?",
             };
             defaultTemplate.AddProperty(property);

             return CreateHalForm(UriFactory.GetRelationsUri(FormNameMoio), defaultTemplate);
        }
示例#2
0
 private static HalForm CreateHalForm(string selfHref, DefaultTemplate defaultTemplate)
 {
     var template = new Template(defaultTemplate);
      var halForm = new HalForm(new Links(selfHref), template);
      return halForm;
 }
示例#3
0
文件: Template.cs 项目: bouwe77/fmg
 public Template(DefaultTemplate defaultTemplate)
 {
     DefaultTemplate = Enforce.ArgumentNotNull(defaultTemplate, nameof(defaultTemplate));
 }