Ejemplo n.º 1
0
 public string AuthenticateFacebookeUser(string fbAccessToken, string ownerName, string emailAddress)
 {
     var ownerExists = context.Owners.Where(o => o.EmailAddress == fbAccessToken).FirstOrDefault();
     if (ownerExists != null)
     {
         ownerExists.FBAccessToken = fbAccessToken;
         context.SubmitChanges();
         return ownerExists.OwnerId;
     }
     else
     {
         var guid = Guid.NewGuid().ToString();
         var ownerId = guid.Substring(guid.Length - 8);
         var owner = new Owner { OwnerId = ownerId, OwnerName = ownerName, EmailAddress = emailAddress, TeamName = ownerName, IsCommish = false, IsActive = true, FBAccessToken = fbAccessToken };
         context.Owners.InsertOnSubmit(owner);
         context.SubmitChanges();
         return ownerId;
     }            
 }
Ejemplo n.º 2
0
 partial void DeleteOwner(Owner instance);
Ejemplo n.º 3
0
 partial void UpdateOwner(Owner instance);
Ejemplo n.º 4
0
 partial void InsertOwner(Owner instance);