예제 #1
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public UserInfo GetItem(int ID)
        {
            BO       bo    = new BO();
            UserInfo model = bo.Context().Sql($@"
                SELECT * FROM UserInfo WHERE ID = {ID} "
                                              ).QuerySingle <UserInfo>();

            return(model);
        }
예제 #2
0
        /// <summary>
        /// 返回一个dynamic对象
        /// Add:yuangb 2019-3-29
        /// </summary>
        /// <param name="columns">dynamic包含的列</param>
        /// <param name="froms">查询来源</param>
        /// <param name="where">查询条件</param>
        /// <returns></returns>
        public dynamic GetSingle(string columns, string froms, string where)
        {
            BO      bo  = new BO();
            dynamic dyn = bo.Context().Sql($@"
                SELECT
	                {columns}
                FROM
	                {froms}
                WHERE
	                {where}
                ").QuerySingle <dynamic>();

            return(dyn);
        }