Example #1
0
        public void AddLink(string obj, LoginProfile profile)
        {
            var db = DbOptions.Get(DbId);

            db.ExecuteScalar <int>(
                new SqlInsert("account_links", true)
                .InColumnValue("id", obj)
                .InColumnValue("uid", profile.HashId)
                .InColumnValue("provider", profile.Provider)
                .InColumnValue("profile", profile.ToSerializedString())
                .InColumnValue("linked", DateTime.UtcNow)
                );
            AccountLinkerStorage.RemoveFromCache(obj);
        }
        public void AddLink(string obj, LoginProfile profile)
        {
            var accountLink = new AccountLinks
            {
                Id       = obj,
                UId      = profile.HashId,
                Provider = profile.Provider,
                Profile  = profile.ToSerializedString(),
                Linked   = DateTime.UtcNow
            };

            AccountLinkContext.AddOrUpdate(r => r.AccountLinks, accountLink);
            AccountLinkContext.SaveChanges();

            AccountLinkerStorage.RemoveFromCache(obj);
        }
Example #3
0
        public void AddLink(string obj, LoginProfile profile)
        {
            CacheEntry.Reset(obj);

            using (var db = new DbManager(_dbid))
            {
                db.ExecuteScalar <int>(
                    new SqlInsert(LinkTable, true)
                    .InColumnValue("id", obj)
                    .InColumnValue("uid", profile.HashId)
                    .InColumnValue("provider", profile.Provider)
                    .InColumnValue("profile", profile.ToSerializedString())
                    .InColumnValue("linked", DateTime.UtcNow)
                    );
            }
        }
Example #4
0
 public void AddLink(string obj, LoginProfile profile)
 {
     using (var db = new DbManager(dbid))
     {
         db.ExecuteScalar <int>(
             new SqlInsert("account_links", true)
             .InColumnValue("id", obj)
             .InColumnValue("uid", profile.HashId)
             .InColumnValue("provider", profile.Provider)
             .InColumnValue("profile", profile.ToSerializedString())
             .InColumnValue("linked", DateTime.UtcNow)
             );
     }
     notify.Publish(new LinkerCacheItem {
         Obj = obj
     }, CacheNotifyAction.Remove);
 }
 public void AddLink(string obj, LoginProfile profile)
 {
     using (var db = new DbManager(dbid))
     {
         using (var tx = db.BeginTransaction())
         {
             db.ExecuteScalar <int>(
                 new SqlInsert(LinkTable, true)
                 .InColumnValue("id", obj)
                 .InColumnValue("uid", profile.HashId)
                 .InColumnValue("provider", profile.Provider)
                 .InColumnValue("profile", profile.ToSerializedString())
                 .InColumnValue("linked", DateTime.UtcNow)
                 );
             tx.Commit();
         }
     }
 }