Ejemplo n.º 1
0
        public LoginUser GetUserByOpenID(string openID, OpenAuthType authType)
        {
            Check.Argument.IsNotEmpty(openID, "openID");
            Check.Argument.IsNotNegativeOrZero((int)authType, "authType");

            var cacheKey = CacheKey.USER_INFO_BY_OPENID + openID + authType.ToString();
            var user = Cache.Get<LoginUser>(cacheKey);

            if (user == null)
            {
                user = this.Context.Sql(getUserByOpenID_Sql)
                                   .Parameter("@openID", openID)
                                   .Parameter("@authType", authType)
                                   .QuerySingle<LoginUser>();

                if (user != null)
                    Cache.Add(cacheKey, user, new TimeSpan(1, 0, 0));
            }

            return user;
        }
Ejemplo n.º 2
0
 public OpenAuthShip FindByOpenID(string openID, OpenAuthType openAuthType)
 {
     return this._session.QueryOver<OpenAuthShip>().Where(o => o.OpenID == openID && o.Type == openAuthType).SingleOrDefault();
 }
Ejemplo n.º 3
0
 public OpenAuthShipCreated(int userID, string openID, OpenAuthType openAuthType)
 {
     this.UserID = userID;
     this.OpenID = openID;
     this.OpenAuthType = openAuthType;
 }