This file contains 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
namespace TryToRenderTemplate | |
{ | |
public class RenderTemplate: IRenderTemplate | |
{ | |
........... | |
/// <summary> | |
/// Get the information for an existing template | |
/// </summary> | |
/// <param name="templateSlug"></param> |
This file contains 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 async Task SendMessage(string message) | |
{ | |
var x = message; | |
var receivedData = (List)JsonConvert.DeserializeObject(message, | |
typeof(List)); | |
foreach (var eachItem in receivedData) | |
{ | |
var onlineUserId = eachItem.UserId; | |
string jobid = GetQueryString(); |
This file contains 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
private string GetQueryString() | |
{ | |
string x = Context.QueryString["userid"]; | |
return x; | |
} |
This file contains 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 override Task OnConnected() | |
{ | |
string jobid = GetUserId(); | |
if (jobid != null) | |
{ | |
Connections.Add(jobid, Context.ConnectionId); | |
} | |
return base.OnConnected(); | |
} | |
............ |
This file contains 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 Functions | |
{ | |
[NoAutomaticTrigger] | |
public static void ManualTrigger(TextWriter log, int value, [Queue("queue")] | |
out string message) | |
{ | |
var c = new Functions(); | |
c.InvokeHub().Wait(); | |
message = "hi."; | |
Console.Write(message); |
This file contains 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 ConnectionMapping | |
{ | |
private readonly Dictionary _connections = | |
new Dictionary(); | |
public int Count | |
{ | |
get { return _connections.Count; } | |
} |
This file contains 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
//import these files on top of cshtml | |
http://~/Scripts/jquery.signalR-2.2.0.js | |
http://localhost:2120/signalr/hubs | |
//Main logic | |
$(document).ready(function () { | |
console.log($.connection); | |
$.connection.hub.url = "http://localhost:53561/signalr"; | |
// Create a function that the hub can call to send messages |
This file contains 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
//import these files on top of cshtml | |
http://~/Scripts/jquery.signalR-2.2.0.js | |
http://localhost:2120/signalr/hubs | |
//Main logic | |
$(document).ready(function () { | |
console.log($.connection); | |
$.connection.hub.url = "http://localhost:53561/signalr"; | |
This file contains 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 partial class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
ConfigureAuth(app); | |
app.MapSignalR(); | |
} | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1> | |
{{TITLE}} | |
</h1> | |
<div> | |
This example is {{ADJECTIVE}}. | |
</div> |
NewerOlder