Required role: | Moderator |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BlazorDiffusion.ServiceModel;
namespace BlazorDiffusion.ServiceModel
{
public partial class Signup
: StatBase
{
public virtual int Id { get; set; }
public virtual SignupType Type { get; set; }
public virtual string Email { get; set; }
public virtual string Name { get; set; }
public virtual DateTime? CancelledDate { get; set; }
}
public enum SignupType
{
Updates,
Beta,
}
public partial class StatBase
{
public virtual string RefId { get; set; }
public virtual int? AppUserId { get; set; }
public virtual string RawUrl { get; set; }
public virtual string RemoteIp { get; set; }
public virtual DateTime CreatedDate { get; set; }
}
[ValidateRequest("HasRole(`Moderator`)")]
public partial class UpdateSignup
: IPatchDb<Signup>
{
public virtual int Id { get; set; }
public virtual SignupType? Type { get; set; }
[Validate("Email")]
public virtual string Email { get; set; }
public virtual string Name { get; set; }
public virtual DateTime? CancelledDate { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/UpdateSignup HTTP/1.1
Host: blazordiffusion.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
type: Updates,
email: String,
name: String,
cancelledDate: 0001-01-01
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { id: 0, type: Updates, email: String, name: String, cancelledDate: 0001-01-01, refId: String, appUserId: 0, rawUrl: String, remoteIp: String, createdDate: 0001-01-01 }