Created
July 2, 2018 07:31
-
-
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
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
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