MyApp

<back to all web services

CreateFileSystemItem

Files
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports MyApp.ServiceModel

Namespace Global

    Namespace MyApp.ServiceModel

        Public Partial Class CreateFileSystemItem
            Implements ICreateDb(Of FileSystemItem)
            Implements IFileItem
            Public Overridable Property FileAccessType As FileAccessType? Implements IFileItem.FileAccessType
            Public Overridable Property File As FileSystemFile
        End Class

        Public Enum FileAccessType
            [Public]
            Team
            [Private]
        End Enum

        Public Partial Class FileSystemFile
            Implements IFile
            Public Overridable Property Id As Integer Implements IFile.Id
            Public Overridable Property FileName As String Implements IFile.FileName
            Public Overridable Property FilePath As String Implements IFile.FilePath
            Public Overridable Property ContentType As String Implements IFile.ContentType
            Public Overridable Property ContentLength As Long Implements IFile.ContentLength
            <References(GetType(FileSystemItem))>
            Public Overridable Property FileSystemItemId As Integer
        End Class

        Public Partial Class FileSystemItem
            Implements IFileItem
            Public Overridable Property Id As Integer
            Public Overridable Property FileAccessType As FileAccessType? Implements IFileItem.FileAccessType
            Public Overridable Property File As FileSystemFile
            Public Overridable Property AppUserId As String
        End Class
    End Namespace
End Namespace

VB.NET CreateFileSystemItem DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/CreateFileSystemItem HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"fileAccessType":"Public","file":{"id":0,"fileName":"String","filePath":"String","contentType":"String","contentLength":0,"fileSystemItemId":0}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":0,"fileAccessType":"Public","file":{"id":0,"fileName":"String","filePath":"String","contentType":"String","contentLength":0,"fileSystemItemId":0},"appUserId":"String"}