Hi All I have two class
- public partial class UserMaster
- {
- public Guid UserId { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Email { get; set; }
- public int RoleId { get; set; }
- public bool Status { get; set; }
- public string PasswordSalt { get; set; }
- public string PasswordHash { get; set; }
- public DateTime CreatedDate { get; set; }
- }
And
- public class RMangerViewModel
- {
- public Guid UserId { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- }
Basically Manager is from
UsereMaster but identify by
RoleId=3.
I need to fill RMangerViewModel from UserMaster where RoleId = 3 using linq.
Note: List of UserMaster will be fill up by _context.UserMaster.