Exemplo n.º 1
0
        public IActionResult GetById(Guid id)
        {
            // var dynamicParameters = new DynamicParameters(); cách 2: lấy dữ liệu khách hàng theo id
            // dynamicParameters.Add("@CustomerGroupId",id);
            // Thực hiện Query lấy dữ liệu: cách 2 lấy dữ liệu khách hàng theo id
            // var customerGroup = _dbConnection.Query<CustomerGroup>($"SELECT * FROM CustomerGroup WHERE CustomerGroupId='{id.ToString()}'").FirstOrDefault();

            // lấy dữ liệu từ DB
            var entity = _dbConnector.GetById <MISAEntity>(id);

            // trả dữ liệu cho client
            return(Ok(entity));
        }
Exemplo n.º 2
0
 public IActionResult Get(string id)
 {
     return(Ok(dbConnector.GetById <Employee>(id)));
 }