コード例 #1
0
        /// <summary>
        /// Gets the specified identifier.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <example><code>GET: api/Employee/5</code></example>
        /// <returns>EmployeeDto</returns>
        public EmployeeDto Get(Int32 id)
        {
            var dtoEntity = new EmployeeDto()
            {
                EmployeeID = id
            };

            return(_EmployeeBO.GetEntiyByPK(dtoEntity));
        }
コード例 #2
0
        /// <summary>
        /// GetOne
        /// </summary>
        /// <param name="request"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public override async Task <GetEmployeeOneReply> GetOne(GetEmployeeOneRequest request, ServerCallContext context)
        {
            CheckRequestInvalid(request);

            var employeeDto = _EmployeeBO.GetEntiyByPK(new EmployeeDto {
                EmployeeID = request.EmployeeID
            });

            return(await Task.FromResult(new GetEmployeeOneReply
            {
                IsSuccess = true,
                EmployeeID = employeeDto.EmployeeID,
                ContactID = employeeDto.ContactID,
                Title = employeeDto.Title,
                NationalIDNumber = employeeDto.NationalIDNumber
            }));
        }