상속: INotifyPropertyChanging, INotifyPropertyChanged
예제 #1
0
 partial void DeleteUserSiteAuthorization(UserSiteAuthorization instance);
예제 #2
0
 partial void UpdateUserSiteAuthorization(UserSiteAuthorization instance);
예제 #3
0
파일: User.cs 프로젝트: Lacoste/stackid
        /// <summary>
        /// Grants authorization to the given host, such
        /// that subsequent calls to HasGrantedAuthorization with the same host
        /// will return true.
        /// </summary>
        public void GrantAuthorization(string host)
        {
            host = host.ToLowerInvariant();

            var db = Current.WriteDB;

            var newGrant = new UserSiteAuthorization
            {
                CreationDate = Current.Now,
                SiteHostAddress = host,
                UserId = this.Id
            };

            db.UserSiteAuthorizations.InsertOnSubmit(newGrant);
            db.SubmitChanges();
        }
예제 #4
0
 partial void InsertUserSiteAuthorization(UserSiteAuthorization instance);
예제 #5
0
        public void UserSiteAuthorizationInsertWithUserId()
        {
            var r = new Restrictions();

            var siteAuth = new UserSiteAuthorization
            {
                UserId = 1
            };

            var updates = new Dictionary<object, Restrictions.ShadowModifiedMember[]>();

            string ignored;
            Assert.IsTrue(r.IsValidChangeSet(updates, new List<object>(), new List<object>() { siteAuth }, new List<object>(), new List<int>() { 1 }, out ignored));
        }