partial void DeleteAuthorizationData(AuthorizationData instance);
private void detach_AuthorizationDatas(AuthorizationData entity) { this.SendPropertyChanging(); entity.ClientData = null; }
partial void InsertAuthorizationData(AuthorizationData instance);
partial void UpdateAuthorizationData(AuthorizationData instance);
private void attach_AuthorizationDatas(AuthorizationData entity) { this.SendPropertyChanging(); entity.ScopeData = this; }
public Authorization( AuthorizationData data ) { Load( data ); }
private void Load( AuthorizationData data ) { Init(); if ( data != null ) { AuthorizationId = data.authorization_id; ClientId = data.client_id; ScopeId = data.scope_id; LoginId = data.login_id; DateCreated = data.date_created; Active = data.active; } }
public bool Save() { using ( OAuthDataContext context = OAuthContextHelper.GetContext() ) { AuthorizationData data; if ( AuthorizationId > 0 ) { data = context.AuthorizationDatas.FirstOrDefault( a => a.authorization_id == AuthorizationId ); } else { data = new AuthorizationData(); data.date_created = DateTime.Now; } data.client_id = ClientId; data.login_id = LoginId; data.scope_id = ScopeId; data.active = Active; if ( AuthorizationId == 0 ) { context.AuthorizationDatas.InsertOnSubmit( data ); } context.SubmitChanges(); Load( data ); return AuthorizationId > 0; } }