[Route("api/[controller]/[action]")] public class EmployeeListController : ControllerBase { clsLogin objBO = new clsLogin(); public async Task<IActionResult> GetEmployeeList(Int64? TenantId) { try { clsLogin cls = new clsLogin(); LstEmployee objresp = new LstEmployee(); objresp.EmployeeMaster = new List<EmployeeMaster>(); clsLoginCredentials oLoginCredentials = cls.GetWebApiTokenDetail(this.HttpContext); //Creating Client object of Service Reference ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); var result1 = await client.GetEmployeeDataAsync(Convert.ToInt32(TenantId)); var arr = result1; for (int i = 0; i < arr.Count(); i++) { EmployeeMaster obj = new EmployeeMaster(); obj.empM_LegEnt_Id = Convert.ToInt64(arr[i].empM_LegEnt_Id); obj.empM_empId = arr[i].empM_empId; obj.empM_UID = Convert.ToString(arr[i].empM_UID); objresp.EmployeeMaster.Add(obj); } if (objresp.EmployeeMaster.Count > 0) { objresp.ResponseCode = ApiResponseCode.RecordFoundCode; objresp.ResponseMessage = ApiResponseCode.RecordFoundMessage; objresp.ResponseType = ApiResponseCode.RecordFoundType; return Ok(objresp); } return NotFound(); } catch (Exception ex) { throw; } } }
Supporting the community with WF and WCF OSS projects | .NET Blog[^]: This means we will not be adding ASP.NET Web Forms, WCF, Windows Workflow, .NET Remoting and/or the various other smaller APIs to .NET Core.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)