EndpointExtensions.UseConnection<TResponse> method

namespace: Serenity.Services   assemblySerenity.Net.Web

Executes a callback by passing a connection object and converts any exception raised inside to a service response.

public static Result<TResponse> UseConnection<TResponse>(this Controller controller, 
    string connectionKey, Func<IDbConnection, TResponse> handler)
    where TResponse : ServiceResponse, new()
parameter description
TResponse Response type
controller Controller
connectionKey Connection key
handler Handler callback

See Also