Example #1
0
        public EngineInfo GetDataById(string id)
        {
            var dbPara = new DynamicParameters();

            dbPara.Add("id", id, DbType.String);
            return(_dapperHelper.Get <EngineInfo>("Select top 1 FieldC as ValueC from MyTable where ID = @Id", dbPara, CommandType.Text));
        }
Example #2
0
        public Job GetByJobId(int JobId)
        {
            var data = _dapperHelper.Get <Job>($"select * from job  where JobId={JobId}", null,
                                               commandType: CommandType.Text);

            return(data);
        }
        /// <summary>
        /// This method is used for get employee details by id
        /// </summary>
        /// <param name="EmployeeId"></param>
        /// <returns></returns>
        public Employee GetEmployeeById(int EmployeeId)
        {
            var dbParameter = new DynamicParameters();

            dbParameter.Add("EmployeeId", EmployeeId, DbType.String);
            var result = _dapperHelper.Get <Employee>("SP_Employee_GetbyId", dbParameter, commandType: CommandType.StoredProcedure);

            return(result);
        }
Example #4
0
        public JobEntity GetByJobId(int JobId)
        {
            #region using dapper
            var data = _dapperHelper.Get <JobEntity>($"select * from job  where JobId={JobId}", null,
                                                     commandType: CommandType.Text);
            return(data);

            #endregion
        }
 public Student Get(Expression <Func <Student, bool> > expression = null)
 {
     Console.WriteLine("成功调用get方法");
     return(_dapperHelper.Get <Student>(expression));
 }
        public College GetCompanyByID(int ID)
        {
            var data = _dapperHelper.Get <College>("Select * from College where ID ='" + ID + "'", null, commandType: CommandType.Text);

            return(data);
        }
Example #7
0
        public Department GetDepartmentByID(int ID)
        {
            var data = _dapperHelper.Get <Department>("Select * from Department where ID ='" + ID + "'", null, commandType: CommandType.Text);

            return(data);
        }
Example #8
0
        public User GetUserByID(int ID)
        {
            var data = _dapperHelper.Get <User>("Select u.*, ra.RoleName, ra.AccessPages from [User] u Inner join RoleAuthor ra on u.RoleId = ra.Id where u.ID ='" + ID + "'", null, commandType: CommandType.Text);

            return(data);
        }
Example #9
0
        public RoleAuthor GetRoleAuthorByID(int ID)
        {
            var data = _dapperHelper.Get <RoleAuthor>("Select u.* from [RoleAuthor] u where ID ='" + ID + "'", null, commandType: CommandType.Text);

            return(data);
        }
Example #10
0
        public string GetSQLVersion()
        {
            string data = _dapperHelper.Get <string>("Select @@Version", null, commandType: CommandType.Text);

            return(data);
        }