Skip to content

Instantly share code, notes, and snippets.

@jinan-kordab
Created July 2, 2018 07:31
Show Gist options
  • Save jinan-kordab/1c96f3eeda96da0e7467c33992fe7b53 to your computer and use it in GitHub Desktop.
Save jinan-kordab/1c96f3eeda96da0e7467c33992fe7b53 to your computer and use it in GitHub Desktop.
Server side code for Default.aspx - client side part of SignalR example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string BindDatatable(string uniqueUserID,string fullName, string givenName, string familyName, string email, string googleToken)
{
string ConnectionIDUpdated = "false";
using (var db = new WebApplication2.MyEntityFramework.MySignalRUsersEntities())
{
var userDataRecord = (from c in db.UsersTemp
where (c.UniqueUserID == uniqueUserID)
select c).SingleOrDefault();
if (userDataRecord != null)
{
userDataRecord.FullName = fullName;
userDataRecord.GivenName = givenName;
userDataRecord.FamilyName = familyName;
userDataRecord.Email = email;
userDataRecord.GoogleToken = googleToken;
db.SaveChanges();
ConnectionIDUpdated = "true";
}
}
return ConnectionIDUpdated;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment