Last active
May 16, 2018 13:38
-
-
Save jeremydmiller/dc363366d3543420ea0fb3b857c6543b to your computer and use it in GitHub Desktop.
Code Generated for post_one method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SqlSender_HomeEndpoint_post_one : Jasper.Http.Model.RouteHandler | |
{ | |
private readonly SqlServerSettings _sqlServerSettings; | |
private readonly IMessagingRoot _messagingRoot; | |
public SqlSender_HomeEndpoint_post_one(SqlServerSettings sqlServerSettings, IMessagingRoot messagingRoot) | |
{ | |
_sqlServerSettings = sqlServerSettings; | |
_messagingRoot = messagingRoot; | |
} | |
public override async Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) | |
{ | |
var messageContext = _messagingRoot.NewContext(); | |
using (System.Data.SqlClient.SqlConnection sqlConnection2 = new System.Data.SqlClient.SqlConnection(_sqlServerSettings.ConnectionString)) | |
{ | |
await sqlConnection2.OpenAsync(); | |
var sqlTransaction = sqlConnection2.BeginTransaction(); | |
await Jasper.SqlServer.SqlServerOutboxExtensions.EnlistInTransaction(messageContext, sqlTransaction); | |
await SqlSender.HomeEndpoint.post_one(messageContext, sqlTransaction); | |
sqlTransaction.Commit(); | |
await messageContext.SendAllQueuedOutgoingMessages(); | |
sqlConnection2.Close(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment