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);
Beispiel #5
0
 private void detach_AuthorizationDatas(AuthorizationData entity)
 {
     this.SendPropertyChanging();
     entity.ClientData = null;
 }
		private void attach_AuthorizationDatas(AuthorizationData entity)
		{
			this.SendPropertyChanging();
			entity.ScopeData = this;
		}
Beispiel #7
0
 partial void UpdateAuthorizationData(AuthorizationData instance);
Beispiel #8
0
 partial void DeleteAuthorizationData(AuthorizationData instance);
Beispiel #9
0
 partial void InsertAuthorizationData(AuthorizationData instance);
Beispiel #10
0
 private void attach_AuthorizationDatas(AuthorizationData entity)
 {
     this.SendPropertyChanging();
     entity.ScopeData = this;
 }
Beispiel #11
0
 public Authorization( AuthorizationData data )
 {
     Load( data );
 }
Beispiel #12
0
        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;
            }
        }
Beispiel #13
0
        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;
            }
        }