Hi
I have below 2 classes . IN Controller Action method iwant to display only Id , Name , Email , Department Name in Get Method.
- public partial class Employee
- {
- public Employee()
- {
- CreatedOn = DateTime.Now;
- }
- public int ID { get; set; }
- public string Name { get; set; }
- public string Email { get; set; }
- public string Gender { get; set; }
- public Nullable<int> Salary { get; set; }
- public Nullable<int> DepartmentId { get; set; }
- public string Active { get; set; }
- [Display(Name = "Created On")]
- [DataType(DataType.Date)]
- [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
- public Nullable<System.DateTime> CreatedOn { get; set; }
- public Nullable<System.DateTime> UpdatedOn { get; set; }
- public virtual Department Department { get; set; }
- }
- public int ID { get; set; }
- public string ShortName { get; set; }
- public string Description { get; set; }
- public virtual ICollection<Employee> Employees { get; set; }
Thanks