Hi
I have 1 Solution with 3 NameSpaces.
Data Access Layer
public partial class Employee
{
public int ID { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Gender { get; set; }
public Nullable Salary { get; set; }
public Nullable DepartmentId { get; set; }
public string Active { get; set; }
public Nullable CreatedOn { get; set; }
public Nullable UpdatedOn { get; set; }
//public Department Department { get; set; }
public virtual Department Department { get; set; }
}
public partial class Department
{
public int ID { get; set; }
public string ShortName { get; set; }
public string Description { get; set; }
public virtual ICollection Employees { get; set; }
}
API Controller
------------------
namespace ProjectManagement.Controllers
{
public class EmployeesController : ApiController
{
private PMDbEntities db = new PMDbEntities();
// GET: api/Employees
public IHttpActionResult GetEmployees()
{
try
{
var results = (from d in db.Employees
join f in db.Departments
on d.DepartmentId equals f.ID
select new
{
Id = d.ID,
Name = d.Name,
Department = f.Description
}).ToList();
if (results == null)
{
return NotFound();
}
return Ok(results);
}
catch (Exception)
{
return BadRequest();
}
}
}}AT Client side i want to display data using RestSharp in Jquery Datatable.
Secondly do i need to create same Models at Client Side also or i can add Reference of Data Access Layer.
Thanks

Sachin SinghRank #66 · 26.2K reputationPosted Feb 21, 2021, 1:41 AM EST
>(request);
Rajanikant HawaldarRank #110 · 20.3K reputationPosted Feb 20, 2021, 11:43 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Feb 21, 2021, 12:17 AM EST