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
CreatedOn { get; set; } - public Nullable
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
Employees { get; set; }
Thanks
Rijwan AnsariPosted Feb 17, 2021, 6:06 PM
Sachin SinghPosted Feb 17, 2021, 2:50 PM
Ramco RamcoPosted Feb 17, 2021, 2:29 PM
Sachin SinghPosted Feb 17, 2021, 1:59 PM