예제 #1
0
        public IDeleteable <T> In <PkType>(Expression <Func <T, object> > inField, List <PkType> primaryKeyValues)
        {
            var lamResult = DeleteBuilder.GetExpressionValue(inField, ResolveExpressType.FieldSingle);
            var fieldName = lamResult.GetResultString();

            tempPrimaryKeys = new List <string>()
            {
                fieldName
            };
            var result = In(primaryKeyValues);

            tempPrimaryKeys = null;
            return(this);
        }
예제 #2
0
        public int ExecuteCommand()
        {
            DeleteBuilder.EntityInfo = this.Context.EntityMaintenance.GetEntityInfo <T>();
            string sql       = DeleteBuilder.ToSqlString();
            var    paramters = DeleteBuilder.Parameters == null ? null : DeleteBuilder.Parameters.ToArray();

            RestoreMapping();
            AutoRemoveDataCache();
            Before(sql);
            var result = Db.ExecuteCommand(sql, paramters);

            After(sql);
            return(result);
        }
예제 #3
0
        public static DeleteBuilder GetDeleteBuilder(ConnectionConfig currentConnectionConfig)
        {
            DeleteBuilder result = CreateInstance <DeleteBuilder>(GetClassName(currentConnectionConfig.DbType.ToString(), "DeleteBuilder"));

            return(result);
        }