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); }
private static HalForm CreateHalForm(string selfHref, DefaultTemplate defaultTemplate) { var template = new Template(defaultTemplate); var halForm = new HalForm(new Links(selfHref), template); return halForm; }
public Template(DefaultTemplate defaultTemplate) { DefaultTemplate = Enforce.ArgumentNotNull(defaultTemplate, nameof(defaultTemplate)); }