Class FireflyAbstractionsExtensions
public static class FireflyAbstractionsExtensions
- Inheritance
-
objectFireflyAbstractionsExtensions
Methods
AsAttachment(IPhotonActionResponse, string)
public static IPhotonActionResponse AsAttachment(this IPhotonActionResponse rsp, string fileName = null)
Parameters
rsp
IPhotonActionResponsefileName
string
Returns
AsBinary(IPhotonActionResponse, byte[], bool)
public static IPhotonActionResponse AsBinary(this IPhotonActionResponse rsp, byte[] data, bool changeContentType = true)
Parameters
rsp
IPhotonActionResponsedata
byte[]changeContentType
bool
Returns
AsContent(IPhotonActionResponse, BufferWithMetadata)
public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, BufferWithMetadata content)
Parameters
rsp
IPhotonActionResponsecontent
BufferWithMetadata
Returns
AsContent(IPhotonActionResponse, StringWithContentType)
public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, StringWithContentType content)
Parameters
rsp
IPhotonActionResponsecontent
StringWithContentType
Returns
AsError(IPhotonActionResponse, string, HttpStatusCode)
public static IPhotonActionResponse AsError(this IPhotonActionResponse rsp, string msg, HttpStatusCode code)
Parameters
rsp
IPhotonActionResponsemsg
stringcode
HttpStatusCode
Returns
AsGRPC(IPhotonActionResponse, object, bool, bool)
public static IPhotonActionResponse AsGRPC(this IPhotonActionResponse rsp, object model, bool isWeb, bool isText = false)
Parameters
rsp
IPhotonActionResponsemodel
objectisWeb
boolisText
bool
Returns
AsHtml(IPhotonActionResponse, string?)
public static IPhotonActionResponse AsHtml(this IPhotonActionResponse rsp, string? html)
Parameters
rsp
IPhotonActionResponsehtml
string
Returns
AsJsonAsync(IPhotonActionResponse, object, CancellationToken)
public static ValueTask<IPhotonActionResponse> AsJsonAsync(this IPhotonActionResponse rsp, object model, CancellationToken cancellationToken)
Parameters
rsp
IPhotonActionResponsemodel
objectcancellationToken
CancellationToken
Returns
AsMsgPack(IPhotonActionResponse, object)
public static IPhotonActionResponse AsMsgPack(this IPhotonActionResponse rsp, object model)
Parameters
rsp
IPhotonActionResponsemodel
object
Returns
AsProtobuf(IPhotonActionResponse, object)
public static IPhotonActionResponse AsProtobuf(this IPhotonActionResponse rsp, object model)
Parameters
rsp
IPhotonActionResponsemodel
object
Returns
AsRedirect(IPhotonActionResponse, string, HttpRedirectType)
public static IPhotonActionResponse AsRedirect(this IPhotonActionResponse rsp, string redirectUri, HttpRedirectType redirectType = HttpRedirectType.SeeOther)
Parameters
rsp
IPhotonActionResponseredirectUri
stringredirectType
HttpRedirectType
Returns
AsStream(IPhotonActionResponse, StreamWithMetadata)
public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, StreamWithMetadata stream)
Parameters
rsp
IPhotonActionResponsestream
StreamWithMetadata
Returns
AsStream(IPhotonActionResponse, Stream, bool)
public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, Stream stream, bool changeContentType = true)
Parameters
rsp
IPhotonActionResponsestream
StreamchangeContentType
bool
Returns
AsText(IPhotonActionResponse, string?, string)
public static IPhotonActionResponse AsText(this IPhotonActionResponse rsp, string? text, string contentType = null)
Parameters
rsp
IPhotonActionResponsetext
stringcontentType
string
Returns
AsXml(IPhotonActionResponse, object)
public static IPhotonActionResponse AsXml(this IPhotonActionResponse rsp, object model)
Parameters
rsp
IPhotonActionResponsemodel
object
Returns
Log(PhotonException, ILogger, LogLevel, string?)
Log PhotonException
public static PhotonException Log(this PhotonException ex, ILogger logger, LogLevel logLevel, string? msg)
Parameters
ex
PhotonExceptionlogger
ILoggerlogLevel
LogLevelmsg
string
Returns
LogCritical(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogCritical(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogCritical(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogCritical(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
LogDebug(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogDebug(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogDebug(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogDebug(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
LogError(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogError(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogError(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogError(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
LogInformation(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogInformation(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogInformation(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogInformation(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
LogTrace(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogTrace(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogTrace(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogTrace(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
LogWarning(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogWarning(this PhotonException ex, ILogger logger)
Parameters
ex
PhotonExceptionlogger
ILogger
Returns
LogWarning(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogWarning(this PhotonException ex, ILogger logger, string msg)
Parameters
ex
PhotonExceptionlogger
ILoggermsg
string
Returns
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
TExceptioncontext
IActionContexttype
IncidentTypestitle
stringdescription
string
Returns
- TException
Type Parameters
TException
WithBody(IPhotonActionResponse, byte[])
public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, byte[] payload)
Parameters
rsp
IPhotonActionResponsepayload
byte[]
Returns
WithBody(IPhotonActionResponse, string)
public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, string bodyText)
Parameters
rsp
IPhotonActionResponsebodyText
string
Returns
WithCacheControl(IPhotonActionResponse, TimeSpan?, string[]?)
public static IPhotonActionResponse WithCacheControl(this IPhotonActionResponse rsp, TimeSpan? maxAge, string[]? VaryByQueryKeys = null)
Parameters
rsp
IPhotonActionResponsemaxAge
TimeSpan?VaryByQueryKeys
string[]
Returns
WithContentType(IPhotonActionResponse, string)
public static IPhotonActionResponse WithContentType(this IPhotonActionResponse rsp, string contentType)
Parameters
rsp
IPhotonActionResponsecontentType
string
Returns
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
IPhotonActionResponsekey
stringvalue
stringdomain
stringpath
stringexpires
DateTimeOffset?httpOnly
boolmaxAge
TimeSpan?isEssential
boolsecure
boolsameSite
string
Returns
WithCookieValue(IPhotonActionResponse, string, string)
public static IPhotonActionResponse WithCookieValue(this IPhotonActionResponse rsp, string key, string value)
Parameters
rsp
IPhotonActionResponsekey
stringvalue
string
Returns
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
PhotonExceptioncontext
IActionContextmessage
stringappend
bool
Returns
WithHeader(IPhotonActionResponse, string, StringValues)
public static IPhotonActionResponse WithHeader(this IPhotonActionResponse rsp, string key, StringValues values)
Parameters
rsp
IPhotonActionResponsekey
stringvalues
StringValues
Returns
WithHeaders(IPhotonActionResponse, IDictionary<string, StringValues>)
public static IPhotonActionResponse WithHeaders(this IPhotonActionResponse rsp, IDictionary<string, StringValues> headers)
Parameters
rsp
IPhotonActionResponseheaders
IDictionary<string, StringValues>
Returns
WithStatusCode(IPhotonActionResponse, HttpStatusCode)
public static IPhotonActionResponse WithStatusCode(this IPhotonActionResponse rsp, HttpStatusCode code)
Parameters
rsp
IPhotonActionResponsecode
HttpStatusCode
Returns
WithVaryByHeader(IPhotonActionResponse, string)
public static IPhotonActionResponse WithVaryByHeader(this IPhotonActionResponse rsp, string header)
Parameters
rsp
IPhotonActionResponseheader
string
Returns
WithVaryByQueryKeys(IPhotonActionResponse, string[])
public static IPhotonActionResponse WithVaryByQueryKeys(this IPhotonActionResponse rsp, string[] queryKeys)
Parameters
rsp
IPhotonActionResponsequeryKeys
string[]