Esempio n. 1
0
        protected DataInsertingEventArgs OnInserting(string name, object data, string scope)
        {
            var args = new DataInsertingEventArgs(name, GetDataDictionary(data), scope);

            this.OnInserting(args);
            return(args);
        }
        protected DataInsertingEventArgs OnInserting(object data, string scope)
        {
            var args = new DataInsertingEventArgs(this.Name, data, scope);

            this.OnInserting(args);
            return(args);
        }
        protected virtual void OnInserting(DataInsertingEventArgs args)
        {
            var e = this.Inserting;

            if (e != null)
            {
                e(this, args);
            }
        }
Esempio n. 4
0
        protected DataInsertingEventArgs OnInserting(object data, string scope)
        {
            var args = new DataInsertingEventArgs(this.Name, DataDictionary <TEntity> .GetDataDictionary(data), scope);

            //尝试递增注册的递增键值
            DataSequence.Increments(this, (DataDictionary <TEntity>)args.Data);

            this.OnInserting(args);
            return(args);
        }
        protected virtual bool OnInserting(DataInsertionContext context)
        {
            var e = this.Inserting;

            if (e == null)
            {
                return(false);
            }

            var args = new DataInsertingEventArgs(context);

            e(this, args);
            return(args.Cancel);
        }