Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Entity Framework Online Skills Assessment Test

Topics Covered

  • Lazy Load
  • Entity Validation
  • Entity States
  • Entity Objects
  • Deleting an Entity
  • Entity Properties
  • Transactions and SQL
  • Entity Model
  • Entity Framework Designer

Useful for hiring

  • Entity Framework Developer
  • .Net Architect/Developer
  • Senior Software Engineer - Entity Framework

Start hiring job-fit candidates using this assessment

GET A DEMO

"Our recruitment team loves Interview Mocha especially for their skill assessments, simulators, and friendly support. Since using Interview Mocha, we interview only relevant candidates, and this has reduced our time to hire. Recruitment is no longer an hassle for us."

Christoph, e-Zest GmbH
Question

I can not use LIKE operator in Entity framework. And I can not find anything about supporting operator on queries.
What is the best replacement for this?

Answer
    • var q = EFContext.Products.Where(x =>
      SqlFunctions.Find("%CD%BLUE%", x.ProductName) > 0);

    • var q = EFContext.Products.Where(x =>
      SqlFunctions.PatIndex("%CD%BLUE%", x.ProductName) > 0);

    • var q = EFContext.Products.Where(x =>
      SqlFunctions.Search("%CD%BLUE%", x.ProductName) > 0);

Question

application database contains following tables:
Order: OrderID, CustomerID,OrderDate, ShipAddress
Order_Detail: OrderID,PRoductID, UnitPrice,Quantity.
You need to create a LINQ query to retrieve a list of objects that contains the OrderID and CustomerID properties, the total price amount of each Order record. 

Answer
    • from details in dataContext.Order_Detail 
      group details by details.OrderID into g 
      join order in dataContext.Orders on g.Key equals order.OrderID 
      select new { 
          OrderID = order.OrderID,
          CustomerID = order.CustomerID,
          TotalAmount = g.Sum(od = >od.UnitPrice * od.Quantity) 

    • dataContext.Order_Detail.GroupJoin(dataContext.Orders,  
      d = >d.OrderID,  
      o = >o.OrderID,   (dts, ord) = >new { 
          OrderID = dts.OrderID,
          CustomerID = dts.Order.CustomerID,
          TotalAmount = dts.UnitPrice * dts.Quantity 
      } ) 
      EntityConnection

    • from order in dataContext. 
      Orders group order by order.OrderID into g 
      join details in dataContext.Order_Detail on g.Key equals details.OrderID 
      select new { 
          OrderID = details.OrderID,
          CustomerID = details.Order.CustomerID,
          TotalAmount = details.UnitPrice * details.Quantity 

      EntityTransaction

Question

Which method should you call on the ObjectContext, to ensure that the orders are added to the local data store?

Answer
    • ApplyCurrentValues

    • AttachTo

    • AddObject

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO