Class FireflyAbstractionsExtensions
public static class FireflyAbstractionsExtensions
- Inheritance
-
objectFireflyAbstractionsExtensions
Methods
AsAttachment(IPhotonActionResponse, string)
public static IPhotonActionResponse AsAttachment(this IPhotonActionResponse rsp, string fileName = null)
Parameters
rspIPhotonActionResponsefileNamestring
Returns
AsBinary(IPhotonActionResponse, byte[], bool)
public static IPhotonActionResponse AsBinary(this IPhotonActionResponse rsp, byte[] data, bool changeContentType = true)
Parameters
rspIPhotonActionResponsedatabyte[]changeContentTypebool
Returns
AsContent(IPhotonActionResponse, BufferWithMetadata)
public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, BufferWithMetadata content)
Parameters
rspIPhotonActionResponsecontentBufferWithMetadata
Returns
AsContent(IPhotonActionResponse, StringWithContentType)
public static IPhotonActionResponse AsContent(this IPhotonActionResponse rsp, StringWithContentType content)
Parameters
rspIPhotonActionResponsecontentStringWithContentType
Returns
AsError(IPhotonActionResponse, string, HttpStatusCode)
public static IPhotonActionResponse AsError(this IPhotonActionResponse rsp, string msg, HttpStatusCode code)
Parameters
rspIPhotonActionResponsemsgstringcodeHttpStatusCode
Returns
AsGRPC(IPhotonActionResponse, object, bool, bool)
public static IPhotonActionResponse AsGRPC(this IPhotonActionResponse rsp, object model, bool isWeb, bool isText = false)
Parameters
rspIPhotonActionResponsemodelobjectisWebboolisTextbool
Returns
AsHtml(IPhotonActionResponse, string?)
public static IPhotonActionResponse AsHtml(this IPhotonActionResponse rsp, string? html)
Parameters
rspIPhotonActionResponsehtmlstring
Returns
AsJsonAsync(IPhotonActionResponse, object, CancellationToken)
public static ValueTask<IPhotonActionResponse> AsJsonAsync(this IPhotonActionResponse rsp, object model, CancellationToken cancellationToken)
Parameters
rspIPhotonActionResponsemodelobjectcancellationTokenCancellationToken
Returns
AsMsgPack(IPhotonActionResponse, object)
public static IPhotonActionResponse AsMsgPack(this IPhotonActionResponse rsp, object model)
Parameters
rspIPhotonActionResponsemodelobject
Returns
AsProtobuf(IPhotonActionResponse, object)
public static IPhotonActionResponse AsProtobuf(this IPhotonActionResponse rsp, object model)
Parameters
rspIPhotonActionResponsemodelobject
Returns
AsRedirect(IPhotonActionResponse, string, HttpRedirectType)
public static IPhotonActionResponse AsRedirect(this IPhotonActionResponse rsp, string redirectUri, HttpRedirectType redirectType = HttpRedirectType.SeeOther)
Parameters
rspIPhotonActionResponseredirectUristringredirectTypeHttpRedirectType
Returns
AsStream(IPhotonActionResponse, StreamWithMetadata)
public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, StreamWithMetadata stream)
Parameters
rspIPhotonActionResponsestreamStreamWithMetadata
Returns
AsStream(IPhotonActionResponse, Stream, bool)
public static IPhotonActionResponse AsStream(this IPhotonActionResponse rsp, Stream stream, bool changeContentType = true)
Parameters
rspIPhotonActionResponsestreamStreamchangeContentTypebool
Returns
AsText(IPhotonActionResponse, string?, string)
public static IPhotonActionResponse AsText(this IPhotonActionResponse rsp, string? text, string contentType = null)
Parameters
rspIPhotonActionResponsetextstringcontentTypestring
Returns
AsXml(IPhotonActionResponse, object)
public static IPhotonActionResponse AsXml(this IPhotonActionResponse rsp, object model)
Parameters
rspIPhotonActionResponsemodelobject
Returns
Log(PhotonException, ILogger, LogLevel, string?)
Log PhotonException
public static PhotonException Log(this PhotonException ex, ILogger logger, LogLevel logLevel, string? msg)
Parameters
exPhotonExceptionloggerILoggerlogLevelLogLevelmsgstring
Returns
LogCritical(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogCritical(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogCritical(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogCritical(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
Returns
LogDebug(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogDebug(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogDebug(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogDebug(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
Returns
LogError(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogError(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogError(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogError(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
Returns
LogInformation(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogInformation(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogInformation(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogInformation(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
Returns
LogTrace(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogTrace(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogTrace(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogTrace(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
Returns
LogWarning(PhotonException, ILogger)
Log PhotonException
public static PhotonException LogWarning(this PhotonException ex, ILogger logger)
Parameters
exPhotonExceptionloggerILogger
Returns
LogWarning(PhotonException, ILogger, string)
Log PhotonException
public static PhotonException LogWarning(this PhotonException ex, ILogger logger, string msg)
Parameters
exPhotonExceptionloggerILoggermsgstring
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
exTExceptioncontextIActionContexttypeIncidentTypestitlestringdescriptionstring
Returns
- TException
Type Parameters
TException
WithBody(IPhotonActionResponse, byte[])
public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, byte[] payload)
Parameters
rspIPhotonActionResponsepayloadbyte[]
Returns
WithBody(IPhotonActionResponse, string)
public static IPhotonActionResponse WithBody(this IPhotonActionResponse rsp, string bodyText)
Parameters
rspIPhotonActionResponsebodyTextstring
Returns
WithCacheControl(IPhotonActionResponse, TimeSpan?, string[]?)
public static IPhotonActionResponse WithCacheControl(this IPhotonActionResponse rsp, TimeSpan? maxAge, string[]? VaryByQueryKeys = null)
Parameters
rspIPhotonActionResponsemaxAgeTimeSpan?VaryByQueryKeysstring[]
Returns
WithContentType(IPhotonActionResponse, string)
public static IPhotonActionResponse WithContentType(this IPhotonActionResponse rsp, string contentType)
Parameters
rspIPhotonActionResponsecontentTypestring
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
rspIPhotonActionResponsekeystringvaluestringdomainstringpathstringexpiresDateTimeOffset?httpOnlyboolmaxAgeTimeSpan?isEssentialboolsecureboolsameSitestring
Returns
WithCookieValue(IPhotonActionResponse, string, string)
public static IPhotonActionResponse WithCookieValue(this IPhotonActionResponse rsp, string key, string value)
Parameters
rspIPhotonActionResponsekeystringvaluestring
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
exPhotonExceptioncontextIActionContextmessagestringappendbool
Returns
WithHeader(IPhotonActionResponse, string, StringValues)
public static IPhotonActionResponse WithHeader(this IPhotonActionResponse rsp, string key, StringValues values)
Parameters
rspIPhotonActionResponsekeystringvaluesStringValues
Returns
WithHeaders(IPhotonActionResponse, IDictionary<string, StringValues>)
public static IPhotonActionResponse WithHeaders(this IPhotonActionResponse rsp, IDictionary<string, StringValues> headers)
Parameters
rspIPhotonActionResponseheadersIDictionary<string, StringValues>
Returns
WithStatusCode(IPhotonActionResponse, HttpStatusCode)
public static IPhotonActionResponse WithStatusCode(this IPhotonActionResponse rsp, HttpStatusCode code)
Parameters
rspIPhotonActionResponsecodeHttpStatusCode
Returns
WithVaryByHeader(IPhotonActionResponse, string)
public static IPhotonActionResponse WithVaryByHeader(this IPhotonActionResponse rsp, string header)
Parameters
rspIPhotonActionResponseheaderstring
Returns
WithVaryByQueryKeys(IPhotonActionResponse, string[])
public static IPhotonActionResponse WithVaryByQueryKeys(this IPhotonActionResponse rsp, string[] queryKeys)
Parameters
rspIPhotonActionResponsequeryKeysstring[]