Table of Contents

Class FireflyAbstractionsExtensions

Namespace
Phoesion.Glow.SDK
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll
public static class FireflyAbstractionsExtensions
Inheritance
object
FireflyAbstractionsExtensions

Methods

AsAttachment(IPhotonActionResponse, string)

public static IPhotonActionResponse AsAttachment(this IPhotonActionResponse rsp, string fileName = null)

Parameters

rsp IPhotonActionResponse
fileName string

Returns

IPhotonActionResponse

AsBinary(IPhotonActionResponse, byte[], bool)

public static IPhotonActionResponse AsBinary(this IPhotonActionResponse rsp, byte[] data, bool changeContentType = true)

Parameters

rsp IPhotonActionResponse
data byte[]
changeContentType bool

Returns

IPhotonActionResponse

AsContent(IPhotonActionResponse, BufferWithMetadata)

public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, BufferWithMetadata content)

Parameters

rsp IPhotonActionResponse
content BufferWithMetadata

Returns

IPhotonActionResponse

AsContent(IPhotonActionResponse, StringWithContentType)

public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, StringWithContentType content)

Parameters

rsp IPhotonActionResponse
content StringWithContentType

Returns

IPhotonActionResponse

AsError(IPhotonActionResponse, string, HttpStatusCode)

public static IPhotonActionResponse AsError(this IPhotonActionResponse rsp, string msg, HttpStatusCode code)

Parameters

rsp IPhotonActionResponse
msg string
code HttpStatusCode

Returns

IPhotonActionResponse

AsGRPC(IPhotonActionResponse, object, bool, bool)

public static IPhotonActionResponse AsGRPC(this IPhotonActionResponse rsp, object model, bool isWeb, bool isText = false)

Parameters

rsp IPhotonActionResponse
model object
isWeb bool
isText bool

Returns

IPhotonActionResponse

AsHtml(IPhotonActionResponse, string?)

public static IPhotonActionResponse AsHtml(this IPhotonActionResponse rsp, string? html)

Parameters

rsp IPhotonActionResponse
html string

Returns

IPhotonActionResponse

AsJsonAsync(IPhotonActionResponse, object, CancellationToken)

public static ValueTask<IPhotonActionResponse> AsJsonAsync(this IPhotonActionResponse rsp, object model, CancellationToken cancellationToken)

Parameters

rsp IPhotonActionResponse
model object
cancellationToken CancellationToken

Returns

ValueTask<IPhotonActionResponse>

AsMsgPack(IPhotonActionResponse, object)

public static IPhotonActionResponse AsMsgPack(this IPhotonActionResponse rsp, object model)

Parameters

rsp IPhotonActionResponse
model object

Returns

IPhotonActionResponse

AsProtobuf(IPhotonActionResponse, object)

public static IPhotonActionResponse AsProtobuf(this IPhotonActionResponse rsp, object model)

Parameters

rsp IPhotonActionResponse
model object

Returns

IPhotonActionResponse

AsRedirect(IPhotonActionResponse, string, HttpRedirectType)

public static IPhotonActionResponse AsRedirect(this IPhotonActionResponse rsp, string redirectUri, HttpRedirectType redirectType = HttpRedirectType.SeeOther)

Parameters

rsp IPhotonActionResponse
redirectUri string
redirectType HttpRedirectType

Returns

IPhotonActionResponse

AsStream(IPhotonActionResponse, StreamWithMetadata)

public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, StreamWithMetadata stream)

Parameters

rsp IPhotonActionResponse
stream StreamWithMetadata

Returns

IPhotonActionResponse

AsStream(IPhotonActionResponse, Stream, bool)

public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, Stream stream, bool changeContentType = true)

Parameters

rsp IPhotonActionResponse
stream Stream
changeContentType bool

Returns

IPhotonActionResponse

AsText(IPhotonActionResponse, string?, string)

public static IPhotonActionResponse AsText(this IPhotonActionResponse rsp, string? text, string contentType = null)

Parameters

rsp IPhotonActionResponse
text string
contentType string

Returns

IPhotonActionResponse

AsXml(IPhotonActionResponse, object)

public static IPhotonActionResponse AsXml(this IPhotonActionResponse rsp, object model)

Parameters

rsp IPhotonActionResponse
model object

Returns

IPhotonActionResponse

Log(PhotonException, ILogger, LogLevel, string?)

Log PhotonException

public static PhotonException Log(this PhotonException ex, ILogger logger, LogLevel logLevel, string? msg)

Parameters

ex PhotonException
logger ILogger
logLevel LogLevel
msg string

Returns

PhotonException

LogCritical(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogCritical(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogCritical(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogCritical(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

LogDebug(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogDebug(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogDebug(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogDebug(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

LogError(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogError(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogError(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogError(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

LogInformation(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogInformation(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogInformation(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogInformation(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

LogTrace(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogTrace(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogTrace(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogTrace(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

LogWarning(PhotonException, ILogger)

Log PhotonException

public static PhotonException LogWarning(this PhotonException ex, ILogger logger)

Parameters

ex PhotonException
logger ILogger

Returns

PhotonException

LogWarning(PhotonException, ILogger, string)

Log PhotonException

public static PhotonException LogWarning(this PhotonException ex, ILogger logger, string msg)

Parameters

ex PhotonException
logger ILogger
msg string

Returns

PhotonException

ReportIncident<TException>(TException, IActionContext, IncidentTypes, string?, string?)

public static TException ReportIncident<TException>(this TException ex, IActionContext context, IncidentTypes type = IncidentTypes.Error, string? title = null, string? description = null) where TException : Exception

Parameters

ex TException
context IActionContext
type IncidentTypes
title string
description string

Returns

TException

Type Parameters

TException

WithBody(IPhotonActionResponse, byte[])

public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, byte[] payload)

Parameters

rsp IPhotonActionResponse
payload byte[]

Returns

IPhotonActionResponse

WithBody(IPhotonActionResponse, string)

public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, string bodyText)

Parameters

rsp IPhotonActionResponse
bodyText string

Returns

IPhotonActionResponse

WithCacheControl(IPhotonActionResponse, TimeSpan?, string[]?)

public static IPhotonActionResponse WithCacheControl(this IPhotonActionResponse rsp, TimeSpan? maxAge, string[]? VaryByQueryKeys = null)

Parameters

rsp IPhotonActionResponse
maxAge TimeSpan?
VaryByQueryKeys string[]

Returns

IPhotonActionResponse

WithContentType(IPhotonActionResponse, string)

public static IPhotonActionResponse WithContentType(this IPhotonActionResponse rsp, string contentType)

Parameters

rsp IPhotonActionResponse
contentType string

Returns

IPhotonActionResponse

WithCookie(IPhotonActionResponse, string, string, string, string, DateTimeOffset?, bool, TimeSpan?, bool, bool, string)

public static IPhotonActionResponse WithCookie(this IPhotonActionResponse rsp, string key, string value, string domain = null, string path = null, DateTimeOffset? expires = null, bool httpOnly = true, TimeSpan? maxAge = null, bool isEssential = false, bool secure = true, string sameSite = null)

Parameters

rsp IPhotonActionResponse
key string
value string
domain string
path string
expires DateTimeOffset?
httpOnly bool
maxAge TimeSpan?
isEssential bool
secure bool
sameSite string

Returns

IPhotonActionResponse

WithCookieValue(IPhotonActionResponse, string, string)

public static IPhotonActionResponse WithCookieValue(this IPhotonActionResponse rsp, string key, string value)

Parameters

rsp IPhotonActionResponse
key string
value string

Returns

IPhotonActionResponse

WithDebugMessage(PhotonException, IActionContext, string?, bool)

Replace/Append exception message only for development qspaces ( must come After normal .WithMessage() )

public static PhotonException WithDebugMessage(this PhotonException ex, IActionContext context, string? message, bool append = false)

Parameters

ex PhotonException
context IActionContext
message string
append bool

Returns

PhotonException

WithHeader(IPhotonActionResponse, string, StringValues)

public static IPhotonActionResponse WithHeader(this IPhotonActionResponse rsp, string key, StringValues values)

Parameters

rsp IPhotonActionResponse
key string
values StringValues

Returns

IPhotonActionResponse

WithHeaders(IPhotonActionResponse, IDictionary<string, StringValues>)

public static IPhotonActionResponse WithHeaders(this IPhotonActionResponse rsp, IDictionary<string, StringValues> headers)

Parameters

rsp IPhotonActionResponse
headers IDictionary<string, StringValues>

Returns

IPhotonActionResponse

WithStatusCode(IPhotonActionResponse, HttpStatusCode)

public static IPhotonActionResponse WithStatusCode(this IPhotonActionResponse rsp, HttpStatusCode code)

Parameters

rsp IPhotonActionResponse
code HttpStatusCode

Returns

IPhotonActionResponse

WithVaryByHeader(IPhotonActionResponse, string)

public static IPhotonActionResponse WithVaryByHeader(this IPhotonActionResponse rsp, string header)

Parameters

rsp IPhotonActionResponse
header string

Returns

IPhotonActionResponse

WithVaryByQueryKeys(IPhotonActionResponse, string[])

public static IPhotonActionResponse WithVaryByQueryKeys(this IPhotonActionResponse rsp, string[] queryKeys)

Parameters

rsp IPhotonActionResponse
queryKeys string[]

Returns

IPhotonActionResponse