partial void DeleteUserSiteAuthorization(UserSiteAuthorization instance);
partial void UpdateUserSiteAuthorization(UserSiteAuthorization instance);
/// <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(); }
partial void InsertUserSiteAuthorization(UserSiteAuthorization instance);
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)); }