예제 #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));
        }
예제 #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);
        }
예제 #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
        }
예제 #5
0
 public Student Get(Expression <Func <Student, bool> > expression = null)
 {
     Console.WriteLine("成功调用get方法");
     return(_dapperHelper.Get <Student>(expression));
 }
예제 #6
0
        public College GetCompanyByID(int ID)
        {
            var data = _dapperHelper.Get <College>("Select * from College where ID ='" + ID + "'", null, commandType: CommandType.Text);

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

            return(data);
        }
예제 #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);
        }
예제 #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);
        }
예제 #10
0
        public string GetSQLVersion()
        {
            string data = _dapperHelper.Get <string>("Select @@Version", null, commandType: CommandType.Text);

            return(data);
        }