Required role: | Moderator |
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BlazorDiffusion.ServiceModel
Namespace Global
Namespace BlazorDiffusion.ServiceModel
Public Partial Class Signup
Inherits StatBase
Public Overridable Property Id As Integer
Public Overridable Property Type As SignupType
Public Overridable Property Email As String
Public Overridable Property Name As String
Public Overridable Property CancelledDate As Date?
End Class
Public Enum SignupType
Updates
Beta
End Enum
Public Partial Class StatBase
Public Overridable Property RefId As String
Public Overridable Property AppUserId As Integer?
Public Overridable Property RawUrl As String
Public Overridable Property RemoteIp As String
Public Overridable Property CreatedDate As Date
End Class
<ValidateRequest(Validator:="HasRole(`Moderator`)")>
Public Partial Class UpdateSignup
Implements IPatchDb(Of Signup)
Public Overridable Property Id As Integer
Public Overridable Property Type As SignupType?
<Validate(Validator:="Email")>
Public Overridable Property Email As String
Public Overridable Property Name As String
Public Overridable Property CancelledDate As Date?
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/UpdateSignup HTTP/1.1
Host: blazordiffusion.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"id":0,"type":"Updates","email":"String","name":"String","cancelledDate":"0001-01-01T00:00:00"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"id":0,"type":"Updates","email":"String","name":"String","cancelledDate":"0001-01-01T00:00:00","refId":"String","appUserId":0,"rawUrl":"String","remoteIp":"String","createdDate":"0001-01-01T00:00:00"}