Qtr No. 213, New Town Yehlanka Indore 454775
Alex has following Entity Classes in the DAL for the tables Transaction and User for his UPITransaction application. He wants to fetch all the transaction details depending on the UserName.
Choose from the given options that help him achieve the requirement.
public partial class Transaction
{
public string TransactionId { get; set; }
public string TransactionType { get; set; }
public string TransactionDate { get; set; }
public string UserId { get; set; }
public string TransactionStatus { get; set; }
public User User { get; set; }
}
public partial class User
{
public string UserId { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string MobileNumber { get; set; }
public ICollection<Transaction> Transactions { get; set; }
}
Assumptions:
a.Transactions and Users are the DbSet properties in the UPITransactionDBContext
b.Context is an object of the class UPITransactionDBContext
Â
Choose TWO correct options.
var transactionList = (from t in Context.Transactions where t.User.UserName == userName select t).ToList();
var transactionList = (from t in Context.Transactions join u in Context.Users on t.UserId equals u.UserId where u.UserName == UserName select t).ToList();
var transactionList = (from u in Context.Users where u.UserName == userName select u).ToList();
var transactionList = (from u in Context.Users join t in Context.Transactions on u.UserId equals t.UserId where u.UserName == UserName select u).ToList();
To get all Infosys Certified Backend Layers Developer Exam questions Join Telegram Group https://rebrand.ly/lex-group-70b557
We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.
Qtr No. 213, New Town Yehlanka Indore 454775
admin@prepflix.in
Updated on Mon, 15 Sept 2025