Is it possible select only specific fields to return. In these example all Tickets including Username.
LazyLoading is disabled.
[Table("UserProfile")]
public class UserProfile
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
public string Username { get; set; }
public DateTime? LastOnline { get; set; }
public Tickets Tickets { get; set; }
}
Code
var whereQuery= "x => true";
_uow.Users.DbSet.Include("Tickets").Where(whereQuery).OnlyTickets.IncludeUsername();
//or
var whereQuery= "x => true";
_uow.Tickets.DbSet.Include("UserProfile").Where(whereQuery).OnlyTickets.IncludeUsername();