MVC - Entity Framework - SQL Server-1
MVC - Entity Framework - SQL Server-1
23) Which of the following Entity will create a table with the following b. public string Pname{ get; set;}
specifications: [Compare ("CheckPname"."Home"."Error Message="Name not there")]
public JsonResult CheckPname (string Pname)
I. It should have FirstName and should be required {/* validation code*/}
II. It should have LastName and should be Required return Json(result,JsonRequestBehavior.AllowGet);----Ans
III. Full Name must be FirstName LastName
IV. EmployeeID should be primary key c. public string Pname{ get; set;}
V. It should have DepartmentID [Remote ("CheckPname"."Home"."Error Message="Name not there")]
VI. Department Entity should be lazy loading public JsonResult CheckPname (string Pname)
{/* validation code*/}
a. public class Employee return Json(Pname,JsonRequestBehavior.DenyGet);
b. public class Employee{ public string EmployeeId {get;set;} public string
FirstName {get;set;} public string FullName {get;set;}public string d. public string Pname{ get; set;}
DepartmentId{get;set;} public Department Department{get;set;}} [Remote ("CheckPname"."Home"."Error Message="Name not there")]
public JsonResult CheckPname (string Pname)
c. public class Employee{[key]public string EmployeeId{get;set;}public {/* validation code*/}
string return Json(result,JsonRequestBehavior.AllowGet);
FirstName{get;set;}[DatabaseGenerated(DatabaseGeneratedOption.Comp
uted)]public string FullName { get{ return FirstName +"."+ LastName; }} 25)which statements are true about large clr user defined types?
public string DepartmentID{get;set;) public virtual Department (a) Extend exisiting SQL Server Type Sysytem.---ans
Department{get;set;}}------Ans (c)Allow you to store CLR objects in SQL Server Database.---ans
d. public class Employee{ [key] public string EmployeeId {get;set;} public 26)how can we delete the database on the database server if it exists?
string FirstName {get;set;} public string FullName {get;set;}public string ans)Delete(DbConnection)
DepartmentId{get;set;} public Department Department{get;set;}}
27. Which of the following code can be used as an option for partial view
e. public class Employee{[key]public string EmployeeId{get;set;}public string through child request?
FirstName {get;set;}[DatabaseGenerated]public string FullName { get{ return
FirstName +"."+ LastName; }} public string DepartmentID{get;set;) public a. Part 1=@html.Action("Sampleone","Feedback")
Department Department{get;set;}} Part 2= [ChildActionOnly]
public ActionResult Sample_one() b.The method can take and return user-supplied parameters.---Ans
{*..some code..*} c.The method can only take input parameters.
d.They are implemented as public,static methods on a class in a .NET
b. Part 1=@html.Action("Sampleone","Feedback") Framework assembly.-----Ans
Part 2= [ChildAction] e.They are implemented as private,protected methods on a .NET Framework
public ActionResult Sample_one() assembly.
{*..some code..*}
34)What are the benefits of using a Unique index?
c. Part 1=@html.Action("Sample_one","Feedback") a.It is less error prone.
Part 2= [ChildActionOnly] b.Data integrity of the defined columns is ensured.---Ans
public ActionResult Sample_one() c.Additional information helpful to the query optimizer is provided.------Ans
{*..some code..*}---Ans d.The performance is not degraded.-ANS
32)In Lazy loading,the navigation property has to be declared as: a.ii only-Ans
a.static b.Both i and ii
b.public----Ans c.None of the listed options
c.proxy d.i only
d.virtual---Ans
37)What are the limitations of Ownership chaining?
33)Which statements are true about CLR stored procedures? a.Applies only to DML statements:SELECT,INSERT,UPDATE and DELETE.-------
a.It is a reference to a Microsoft.NET Framework common language -Ans
runtime(CLR)method.--------Ans b.The owners of the caliing and the called objects must be the same.-----Ans
c.The owners of the calling and the called objects must be different.
d.Does not apply to dynamic queries inside the module.-------Ans 43)Novak is a given a task by his manager to strictly load a particular image
only after page gets loaded.What will you advice him to do?
38)What does the following syntax do? i.Tell him to use JavaScript.
CREATE TABLE T1(Col1 int primary key,Col2 xml) ii.Tell him to combine OnLoad function with JavaScript.
a.It creates a row in a table. iii.Tell him to use AfterLoad function with JavaScript.
b.It creates a column of type int in the table & sets it as a primary key.---Ans a.i and ii------ans
c.It creates a column of type xml.-----Ans b.ii and iii
d.It creates an empty table. c.i and iii
d.i,ii,iii
39)Partial page rendering does which of the following?
a.Removes the need for the whole page to be refreshed as the result of a 44)In console window,PM stands for _________
HTTPGet. a.Project Manager.
b.Removes the need for the whole page to be refreshed as the result of a b.Package Manager.------Ans
postback.----Ans c.Package Model.
c.Only header of the page that have changed are updated. d.Priority Manager.
d.Only individual regions of the page that have changed are updated.---------
Ans 45)Which statements are true about the GROUPING function?
a.It is an aggregate function that causes an additional column to be used
40)How are user defined functions different from User-defined Stored with a value of 1 when the row is added by either the CUBE or ROLLUP
Procedures? operator.--------ANS
a.In user-defined function the default parameter is specified with a b.It is an aggregate function that causes an additional column to be used with
DEFAULT keyword.-ans a value of 0(True) when the row is added by either the CUBE or ROLLUP
b.In User-defined function omitting the parameter also implies default value. operator.
c.User-defined functions do not support output parameters.--Ans c.It is an aggregate function that causes an additional column to be used
d.User-defined functions do support output parameters. with a value of 0 when the row is not the result of CUBE or ROLLUP
operator.-------ANS
41)Which of the following is used to provide short expression for querying d.It is an aggregate function that causes an additional column to be used with
entities over linq? value equal to the number of rows added by either the CUBE or ROLLUP
a.LINQ to DataSet. operator.
b.LINQ to SQL. e.Grouping is allowed only in the select list associated with a GROUP BY
c.Lambda expression.--------ans clause that contains either the CUBE or RoLLUP operator. ------ANS
d.None of the listed options
46.by default, the entry framework will generate the database queries and
42)Which of the following approach do we avoid working with the visual update commands when your code interacts with the model?
designer or entity framework? Ans:True
a.Code First Approach.-----a
b.Model First Approach. 47.entity is defined as _______ of the object, but not the behavior of the
c.Database Approach. object?(QUES NOT CLEAR)
d.None of the listed options. a.Object
b.Schema---ANS d.[ArgumentOutOfRange.Expected=True]
c.Entity
d.None 53.How are Database-level principles categorized?(Multiple ans)
a.database administrator
48.Entity framework is an open source framework? True or false b.database user-->ans
c.database role-->ans
49.In an application page, you are suppose to take students % between 40- d.windows role
80. which of the following will accomplish this objective?select one e.Application role-->ans
a.[Range (40,80)] 54.In caching,by default the location property have the value___
public virtual int Perc{get;set;} ------Ans a.All
b.[between (40;80)] b.Any--->ans
public virtual int Perc{get;set;} c.None
c.[Range (40,80)] d.Auto
public virtual string Perc{get;set;}
d.[Range (40||80)] 55.Which of the following is a way to install/download a Nuget in your
public virtual int Perc{get;set;} system?
a.In your browser go to nuget.org-->click on download
50.What kind of data does the XML datatypes store in SQL server? b.In a visual studio, right click on references-->Add
a.Office documents LibraryPackageReferences-->search nuget-->Install
b.Memory maps c.All of the listed options---ans
c.XML documents---->ans d.In visual studio, go to tools-->Extension manager-->search Nuget-->Install
d.Fragments--->ans
57.Entity framework support foreign key? t or f Ans: True
51.What does a cache profile do?//hold
i.Cache profile allows libraries to provide fast output to sql queries 58.If your are moving your project from MVC2 to MVC3 what will be the value
ii.Cache profile avoids repetition in cache attributes of "Unobtrusive JavaScriptEnabled" (or) By default value of "Unobstustive
select one: JavaScriptEnabled" is => a.True--->ans
a.Both i and ii-----ANS
b.i only 59.We can write raw sql query in SQLQuery() method in entity framework?
c.ii only T orF => Ans:true
d. None of the listed options https://msdn.microsoft.com/enus/library/jj592907(v=vs.113).aspx
52.Fredrick is carrying out a TDD and is expecting ArgumentOutOfRange 60.Which namespace is used to handle EntityClient provider?
exception but he does not known how to write a code to declare that an a. System.Data.EntityClient--->ans
exception is expected.To help him, which of the following would you choose? b.System.Transactions
select one; c.system.data.annotations
a.[Exception.Expected=ArgumentOutOfRange] d.None of the listed options
b.[ArgumentOutOfRangeException.Expected] **************************************************************
c.[ExpectedException(typeof(ArgumentOutOfRange))]----->ans 1. Which of the following require type-casting in the view?
I.ViewData
II.TempData 10. Which of the following methods make entity framework fro detecting
changes automatically? select one :
Select one: a.DBSet.FInd
a.I only b.DBSet .Remove
b.II only C.DBSEt.Attach
c.Both I and II----ANS d.all-----ans
3. How is a User-defined table-valued function in SELECT,INSERT,UPDATE or 11) Which one in the following is not included in the configuration hierarchy?
DELETE statements is invoked? ASP.NET Application sub directory
ASP.NET root directory
Select one: root web
a. A User-defined table-valued function can be invoked in the FROm clause IIS
of a SELECT,INSERT,UPDATE & DELETE statement--------ANS ASP.NET client server sub directory--ANS
b.A User-defined table-valued function can be invoked as a stored procedure
from a clause of a SELECT,INSERT,UPDATE & DELETE statement 12) Unchanged State is the default state for an entity while the entity is
c.A User-defined table-valued function can be invoked in the WHERE clause retrieved from the database. TRUE-------ANs
of a SELECT,INSERT,UPDATE & DELETE statement
d.A User-defined table-valued function can be invoked in the USING clause of 13) Which of the following are database initializers used in Entity Framework
a SELECT,INSERT,UPDATE & DELETE statement (or) what are available database initializers in EntityFramework Code first
model?
4. You are given a task by your manager that includes assembly binding.Which CreateDatabaseIfNotExist ----ANS
file would you configure? Select one: DropCreateDatabaseIfModelChanges -------ANS
a.System.config DropDatabaseAlways
b.Web.config DropCreateDatabaseAlways ----ANS
c.Machine.config---ANS CreateDatabaseAlways
d.Config.config
15) When a LINQ to Entities is Executed
6. Model Binder Interface defines.select one a) some expression in the query might be executed on the server and
some parts might be executed locally on theclient. Client-side
a. the .dll files that are requested for a model binder evaluation of an expression takesplace before the query is executed
b.the interfacae that are required for a model binder on the server-----ANS
c. the assembly that are required fro a model binder b) some expression in the query might be executed on the server and
d. the methods that are required for a model binder-----ans some parts might be executed locally on the server. Client-side
evaluation of an expression takesplace before the query is executed
7. Which statements are true about the max constant in a varchar type? on the server
a. It can be used when the data can exceed more than 8000 charcters----ans c) some expression in the query might be executed on the server and
b. It can be used to fix the max length of charcters for the entire column-ans some parts might be executed locally on theclient. server-side
c. It can be used to store large blocks of text-----ans evaluation of an expression takesplace before the query is executed
d. It can be used to store large image types. on the server
d) None of the options </p>
a. <% using (Html.BeginForm()) {%><%= Html.AntiXssLibrary()%} 32. What do you understand by XSS attack?. Select One
b. <% using (Html.BeginForm()) {%><%= Html.AntiForgaryToken()%} a. Injection of malicious script-ANS
c. <% using (Html.BeginForm()) {%><%= Html.AntiCSRFToken()%} b. Injection of class definition
d. <% using (Html.BeginForm()) {%><%= Html.AntiCSRFLibrary()%} c. Hacking via Browser
d. Hacking through cookies
30. Which of the following is true in doing DB initialization in config file?
Select one (both a and c are same check once again)
a. <?xml version=”1.0” encoding=”utf- 34. Which action result type will return a temporary redirect (HTTP 302
8”?><configuration><appSettings><add status code) or a permanent redirect (HTTP 301 status code) depending on
key=”DatabaseInitializerFrTypeBlogDataLayer.BlogDBContext, the Boolean parameter?
BlogDataLayer”/></ appSettings></configuration> Select one
a. HttpNotFoundResult
b. <?xml version=”1.0” encoding=”utf-8”?> b. RedirectResult-ANS(https://www.asp.net/mvc/mvc3)
<configuration><appSettings><addkey=”DatabaseInitializerFrTypeBlogDat c. HttpStatusCodeResult
aLayer.BlogDBContext,BlogDataLayer”value=”System.Data.Entity.DropCre d. HttpRedirectResult
ateDatabaseAlways`1[[BlogDataLayer.BlogDBContext, BlogDataLayer]],
EntityFramework”/></ appSettings></configuration> --ANS 35. You are handling a page of event. Now the content and information you
c. <?xml version=”1.0” encoding=”utf- have cached so that it is loading quickly but
8”?><configuration><appSettings><add you need to keep a clock which shows time for the event dynamic. Which of
key=”DatabaseInitializerFrTypeBlogDataLayer.BlogDBContext, the following will be helpful?
BlogDataLayer”/></ appSettings></configuration> a. <%DateTime(t.now);%>
d. <?xml version=”1.0” encoding=”utf- b.<%Response.WriteSubstitution(t=>DateTime.Now.ToLongTimeString())%
8”?><configuration><appSettings><add >------ANS
key=”DatabaseInitializerFrTypeBlogDataLayer.BlogDBContext, c. <% var c = dynamic.DateTime() %>
BlogDataLayer”, value=”Create Database”/></ appSettings></configuration> d. <%session s= new session[“Time”];%>
31. Which of the following statements are true. 36. What is entity Key?Select One
55) Which of the package can be used to write an implementation for
a. An entity key is a property or a set of properties of an entity type ASP.NET Identity that targets different persistence stores such as Azure Table
that are used to determine identity--------ANS Storage,NoSQL databases etc.?
b. An entity key is a property or a set of properties of an entity type that a.Microsoft.AspNet.Identity.Core.------Ans
are used to determine the column for searching index b.Microsoft.AspNet.Identity.EntityFramework.
c. An entity key is a property or a set of properties of an entity type that c.Microsoft.AspNet.Identity.OWIN
are used to identity relationship among the entities. d.Microsoft.ASPNET.Security;
d. All of the listed
57) public class DependencyResolver-is the syntax for Dependency resolver
37. Problem Statement- Peter is a web developer and has created a website class.State True or False.
in ASP.NET MVC3 using razor view. People were giving feedback on his site a.True---------Ans
without going through products detail page. They were navigating to the
feedback page by editing the URL. 58) Which of the following code snippets is correct for an entity Post having
Now as a friend, suggest him to use “ChildAction” through “@HtmlAction”. relationship with Blog?
Which of the following would he choose? a.modelBuilder.Entity<Post>().HasRequired(p=>p.Blog)----Ans
Select one b.modelBuilder.Entity<Post>().NeedRelationship(p=>p.Blog)
a. The solution given by Brock is legitimate c.modelBuilder.Entity<Post>().Required(p=>p.Blog)
b. Peter should use “@Html.GoThrough” in place of “@HtmelAction” d.None of the listed options.
c. Peter should user “ChildActionOnly” in place of “ChildAction”---ANS
d. Such problem can’t exist 60) Which of the following statements are TRUE?
i.Client wins and store wins are actions which are used when concurrency
51) Identify the different types of stored procedures. happens.
a.User-defined stored procedures-Transact SQL & CLR.-------Ans ii.In Client wins the data from the server is loaded in to your entity objects.
b.Compiled Stored Procedures. iii.In Store wins data from the entity object is saved to the database.
c.Extended Stored Procedures.-Ans a.i and ii
d.System Stored Procedures.---Ans b.ii and iii
c.only i------Ans
52) Which method converts string to HTML Encoded string? d.i,ii and iii
a.HtmlUtility.HttpCode.
b.HtmlUtility.XmEncode. **************************************************************
c.HttpUtility.HtmlEncode.-----Ans 1.LINQ to Entities provides developers to write LINQ queries
d.HttpUtility.HtmlCode. Stata True or False. True----ANS
53) Machine.config,contains settings that apply to an entire Network.State 2.DbContext does not support Complied Queries. True----ANS
true or False. b.False.--Ans
3.Linq to Entity Query results are usually returned as which of the following?
54) The ObjectContext class is not thread-safe.State True or False. Select one:
a.True.---Ans a.A collection of zero or more typed entity objects or a projection of complex
types defined in the conceptual model.--------ans
b.Inline collections--------ans
c.Linq to objects c.It can be specified for DDl or logon triggers----------ANS
d.Anonymous types--------ans d.It cannot be specifoed for DDl or logon triggers.
e.All of the listed options.
10.Which of the following provider is used to access data in conceptual
4.Localization is also known as____________.Select one: model?Select one:
a.All the listed options
b.L10N----ANS a.EntityClient provider----ANS
c.LOC-zation b.SqlClientProvider
d.LCn c.EntityModelProvider
d.EntityContext
5.which of the following principals are included in the security context ?
11.How are NON-clustered indexes different from Clustered indexes?select
Select one or more: one:
a. The login
b. The user------ANS a.The data columns of the underlying table are not stored in order based on
c. Authentication memberships--------ANS their nonclustered keys.
d. Role memberships-----ans b.The data rows of the underlying table are sorted and stored in order based
e. Role aggregation on their nonclustered keys.
c.The leaf layer of a nonclustetred index is made up of index pages instead
7.Razor expression starts with______@______. of data pages.----ANS
d.The leaf layer of a nonclustetred index is made up of data pages instead of
8.john is given a task to make his website a bit intelligent and in the process index pages.
he's been told to add autocomletion on the "searchBox".Which of the
following will be helpful? select one: Link:-https://technet.microsoft.com/en-
us/library/ms177484(v=sql.105).aspx
a.$(function()($"#searchBox").autocomplete("/Product/SearchCandidates".{ Nonclustered indexes have the same B-tree structure as clustered indexes,
minChars:3}):}) except for the following significant differences:
b.$(function(){$("#searchBox").autocomplete("/Product/SearchCandidats 1. The data rows of the underlying table are not sorted and stored in order
",{minChars:3});});----ANS based on their nonclustered keys.
c.$(function(){$("#DivideBox")autocomplete("/Product/SearchCandidates",{ 2. The leaf layer of a nonclustered index is made up of index pages instead of
minchars:3});}); data pages.
d.$(function(){$("#searchBox")autocomplete("/Product/SearchCAndidates",
{minchars:3})}); 12.Which of the following statements are true about Clustered index?
9.What is the significance of INSTEAD OF argument of the CREATE TRIGGER Select one or more:
statement?Select one or more: a.A clustered index sorts and stores the data rows of the table or view in order
based on clustered index key -----ANS
a.Specifies that the DML trigger is excuted instead of the triggering SQl b.A clustered index sorts and stores the data columns of the table or view in
statement order based on the clustered index key.
b.It overrides the actions of the triggering statements--ANS c.A clustered index is implemented as a B-tree index strucuture ---ANS
d.A clustered index is implemented as aLinked-list structure.
16.Which of the following annotation is used to mark one or more properties
to be used for concurrency checking while user modifies in an entity?
13.Which of the following object is used to query and modify data?
Select one:
Select one: a.ConcurrencyCheck----ANS
a.ObjectContext----ANS b.DatabaseCheck
b.EntityOject c.EntityCheck
c.DataContext d.None of the listed options
d.None of the listed options.
18.By default in Entity Framework Snapshot change tracking is enabled
14. Your manager has given youa task to write a code to list recent 30 events snapshot change tracking mechanism.State true or false
and this should be accessible to no one other than admins.which of the True----ANS
following should you choose?select one:
20.George wants to make the appearance of his site better.He wants to show
a.public class EventController:Controllers{public ActionResult an image when a "divhello" result takes time to display.
Index(){AspNerDB db = new AspNerDB(); var
f=db.WebEvents.OrderByDescending(e=>e.EventTime).take(30);return Which of the following should he choose?
View(f);}} Select one:
b.[Authorize(Roles="Managers")]public class a.[....@Ajax.ActionLink("Hello","Hello",new
EventController:Controllers{public ActionResult Index(){AspNerDB db = new AjaxOptions(){UpdateTargetID="div-
AspNerDB(); var hello",HttpMethod="GET",LoadingElementId="divloadingimage"})....]
f=db.WebEvents.OrderByDescending(e=>e.EventTime).take(30);return b.[....@Ajax.ActionLink("Hello","Hello",new
View(f);}} AjaxOptions(){UpdateTargetID="div-
c.[Authorize(Roles="Admin")]public class EventController:Controllers{public hello",HttpMethod="GET",LoadingElementId="divloadingimage"})....]
ActionResult Index(){AspNerDB db = new AspNerDB(); var c.[....@Ajax.ActionLink(AjaxOptions(){UpdateTargetID="divhello",HttpMetho
f=db.WebEvents.OrderByDescending(e=>e.EventTime).take(30);return d="GET",LoadingElementId="divloadingimage"})....]
View(f);}}----ANS d.[....@Ajax.ActionLink("Hello","Hello",new
d.public class EventController:Controllers{public ActionResult AjaxOptions(){UpdateTargetID="divhello",HttpMethod="GET",LoadingEleme
Index(){AspNerDB db = new AspNerDB(); var ntId="divloadingimage"})....]------ans
f=db.WebEvents.OrderByAscending(e=>e.EventTime).take(30);return
View(f);}} 21.which template is used in entity framework to generate code in C# by
reading .edxm file?
15.Which of the following are the data annotations attribute? a. C# template
b. T4 template--ANS
Select one or more c. XML template
a.Compare d. none
b.Range
c.Required----ANS 23.What is Dependency Injection?Select one:
d.StringLength----ANS
a.A technique for achieving tight coupling between objects and their b. None of the listed options
collaborators. c. It will add custom filter "SampleFilter" to the GlobalFilters--------ANS
b.A technique for achieving loose coupling between objects and their d. it is not possible to add new filter, so it will give an error
collaborators.----ANS
c.A technique for achieving tight coupling between Model and their views. 32. Which of the following statements are true about extended stored
d.A technique for achieving tight coupling between Model and their procedures?
respective server.
Select one or more:
24. Entities define the______________of an object but not the behavior of a. they are inherited from another user defined stored procedure
the object.select one: b. they are DLLs developed in a programming language like c that an instance
of Microsoft SQL server can dynamically load and run---ANS
a.Object c. they run directly in the address space of an instance of SQL server---ANS
b.schema----ANS d. they are programmed by using the SQL server extended stored procedure
c.Entity API---ANS
d.None of the liosted options.
33. ObjectContext mainly used for which of the following ?
25.A basic TDD cycle is______. Select one:
i. Database connection
a.Red-Green-Refactor----ANS ii. Object set of every entity
b.Debud-Error-Resolve iii. state of pending changes
c.Red-Green-Resolve
d.Fail-Pass-Repeat Select one:
a. i and ii
26.We can pass information from a controller to a view using ViewBag. b. i and iii
State true or False: True----ANS c. ii and iii
d. i, ii and iii---ANS
28.Which of the following keyword is used for lazy loading related data in
entity framework? 36. Which statements are true about nonclustered indexes with respect to
partitions?
Select one:
a.protected select one or more:
b.virtual---ANS a. nonclustered indexes have one row in sys.partitions with index_id >0 for
c.const each partition used by the index---ANS
d.abstract b. nonclustered indexes have one column in sys.partitions with index_id >0
for each partition used by the index
31. GlobalFilters.Filters.Add(new SampleFilter())- what will the above piece of c. by default, a nonclustered index has a single partition---ANS
code do ? d. by default, a nonclustered index has a multiple partition
e. each partition has a B-tree structure that contains the index rows for that
Select one: specific partition------ans
a. It will move it sample filter to the global filter
37. If we want to retrieve friend along with contact entity, which of the return View();
following code will fetch us the required result ? }
b. public ActionResult Index()
select one: {
a. public.ActionResult index(){var friends = db.Friends.Include(a => View@Message = "Hello World";
a.Contacts);return View(friends);}---ANS return View();
b. public.ActionResult index(){var friends = db.Friends;return View(friends);} }
c. public.ActionResult index(){var friends = db.Friends.Insert(a => c. None of the listed options
a.Contacts);return View(db.friends);} d.public ActionResult Index()
d. public.ActionResult index(){var friends = db.Friends.add(a => {
a.Contacts);return View(friends);} ViewBag.Message = "Hello World";---ANS
return View();
38. How does SQL Server execute a stored procedure or a trigger ? }
select one or more: 41. "Type or Namespace name "SampleTest" could not be found" - you are
a. SQL server stores only the source for stored procedures and rtiggers---ANS getting the above error while you trying to build a test. what could be the
b. SQL server keeps the stored procedures & triggers in compiled form for reason ?select one:
future execution
c. when a stored procedure or trigger is first executed, the source is compiled a. You didn't instantiate the object for the sampletest controller and view
into an execution plan----ANS b. you didn't have the class called "sample test"
d. if the stored procedure or trigger is again executed before the execution c. the inline constructor is yet to get validated
plan is aged from memory, the relational d. you have not parsed the class assembly—ANS
engine detects the existing plan and reuse it------ANS
e. if the execution plan has aged out of memory, a new plan is built------ANS 42. if we use database first generation a Dbcontext is generated by default
State true or false a. true-ANS
39. Jason is trying to access Appsettings of "sampleserverA" & the accidently
wrote this varserver = ConfigurationManager.Appsettings["sampleserver"];- 43. which of the following are the standard query operators of LINQ ?
what result will he get ? select one:
select one:
a. He will get an alert a. select
b. He will get a nullvalue back b. where
c. He will get a ArgumentException--ANS c. groupby
d. All the listed options d. all the listed options---ANS
40. choose a code block which will show "Hello World" on the WEb page 47. how is the information returned from table-valued functions ?
52.Rafael is a new developer and the manager has told him to make the Selct one or more:
current code less complex.The current code has all the html and processing a. Database file name shouuld not be more than 8 characters
code in same file.Which of the following should he choose? b.Database file name should be unique - Ans
c.The file must reside on one of the following devices: the local server on
Select one: which SQL Server is installed,a Storage
a.Advice him to use seperate models and controller for each logic and store Area Network[SAN],or an iSCSI-based network- Ans
it in new database d.The path specified must exist on the drive prior to creating the database---
b.Advice him to use partial views and create custom Html helpers to make ---- Ans
the ocde readable and less croeded of all the things in one place.-------ANS
c.Advice him to create a new page for every logic. 57.find the correct code to execute sql raw query in the entity frameqwork
d.None of the listed option from the following
select one:
53.Which class is used for transactions in entity framework? Select one: a.using(var ctx = new schoolDBentities())
a.System Transaction---ANS {
b.SqlTransaction varstudentlist = ctx.students.sql("select*from
c.EntityTransaction student").tolist<student>();
d.None of the listed options. }
b.none of these 59.Which of the following is issued to obtain a configuration object for a given
c.using(var ctx = new schoolDBentities()) property in Fluent API?
{
varstudentlist = ctx.students.execute("select*from Select one:
student").tolist<student>(); a.ToTable()
} b.HasKey()
d.using(var ctx = new schoolDBentities()) c.HasDatabaseGeneratedOption()
{ d.Property()---ANS
varstudentlist = ctx.students.sqlquery("select*from
student").tolist<student>();---ANS 60.Which of the following are database initialization strategies in EF code
} First?
Select one or more:
58.Show current date using javascript as Sat Jun 4 2016.select one: a.CreateDatabaseIfNotExists---ANS
b.MigrateDatabaseToLatestVersion
a.---ANS c.CustomDBinitializer---ANS
<p id-"sample"></p> d.AlterDatabasewithchanges
<script> *************************************************************
var d= new Date(); Entity Framework supports three ways to load related data -
document.getElementById("sample").innerHTML=d.toDateString(); eager loading, lazy loading and explicit loading. The techniques
</script> shown in this topic apply equally to models created with Code First and the
b. EF Designer.
<p id-"sample"></p>
<script> 60.which of the following loading is supported by Entity framework?
var d= new Date();
document.getElementById("sample").innerHTML=b.toDateString(); select one:
</script> a.Eager Loading
c. b.Lazy Loading
<p id-"sample"></p> c.Explictly Loading
<script> d.All ------ANS
var b= new Date();
document.getElementById("sample").innerHTML=d.toDateString(); 57.dependency resolver() is destructor b.false...............ans
</script>
d. 56.where can CLR functions be used?select one or more: (doubt)
<p id-"sample"></p>
<script> a.CLR functions can be used to access external files------ANS
var d= new Date(); b.CLR functions can be used to access network resources------ANS
document.getElementById("sample").innerHTML=d.toDate(); c.CLR functions can be used to configure the instance of SQL server------ANS
</script> d.CLR functions can be used to access WEb services------ANS
e.CLR functions can be used to connect to other databases ------ANS
55.The syntax of GetService Method is?Select one
Select one or more:
a.object.GetService(Type serviceType ) a.POCO entity----ANS
b.object GetService(Type serviceType )------ANS b.Dynamic proxy entity---ANS
c.object GetService(object.serviceType ) c.DbContext
d.object GetService(Type.serviceType ) d.ObjectContext
54.output cache is used to cache output of a controller ans:true 47.Which statements are true about RANK function?
It enables us to cache the content returned by any controller method so that Select one or more:
the same content does not need to be generated each time the same a.It returns the rank of each row in the table within the partition of a
controller method is invoked database.-----ANS
b.The rank of a row is equal to the number of ranks that come before the row
53.entity sql is a storage independent query language ans:true in question.
c.The rank of a row is one plus the number of ranks that come before the row
50.How can we get the single employee name when there are many in question-----ANS
employees whose name is "John" in the database? Select one: d.the RANK function returns consecutive integers.
e.The Rank function does not always return consecutive integers. --ANS
a.var employee=(from emp in contextobject.Employee where
emp.EmployeeName="John"select emp).FirstOrDefault<Employee>() 46.LINQ to XML is based on in-memory XML programming interface.
b.var employee=(from emp in contextobject.Employee where State True or False. True-ANS
emp.EmployeeName=="John"select emp).FirstOrDefault<Employee>()----
ANS 45.What are the conditions for assemblies created by using EXTERNAL
c.var employee=(from emp in contextobject.Employee where ACCESS permission sets? Select one or more:
emp.EmployeeName=="test" select emp);
d.None of the listed options a.The assesmbly code should be type-safe-ANS
b.the assesmbly should contain only static data members in its classes unless
49.Which of the following does the input to QueryOptimizer consist? they are marked as read-only
c.the classes in the assesmbly must contain finalizer methods
Select one or more: d.the classes or methods of the assesmbly should be annotated only with
a.The query---------ans allowed
b.The database schema---------ans codes attributes-------ANS
c.The database statistics---------ANS
d.the selected rows. (https://msdn.microsoft.com/en-us/library/ms189524.aspx)
Note:The input to the optimizer consists of the query, the database schema 42.Which command will remove the package?Select one:
(table and index definitions), and the database statistics.
(https://technet.microsoft.com/en-us/library/ms190623(v=sql.105).aspx) a.Remove packageName
b.Delete package
48.Which are the following are the type of entity? c.Uninstall-package PackageName ---ANS
d.None of the listed options. d) The rank of a row is one plus the number of ranks that come before the
row in question
Ref Link: http://stackoverflow.com/questions/17653633/uninstall-
entityframework-using-the-package-manager-console 37.You are given a task by your manager that include assembly binding??
ans:Machine.Confing
41.You need to write a view to show Hi!"username" If user is authenticated Note: Machine.config contains configuration settings for machine-wide
display signoff link & sign in link for anonymous user.Which of the following assembly binding, built-in remoting channels, and ASP.NET.
should you choose?Select one:
36) What does the update command do?
a.<%if(Request.IsAuthenticated){Hi!<%=Html.Encode(page.User.Identity.Un a) Updates a package----------Ans
ame)%>[<%=Html.ActionLink("SignOff","SignOff","Account")%>]<%}else{%>[ b) Updates the project
<%=Html.ActionLink("Sign In","Sign In","Account")%>]<%}%>----------ANS c) Updates the Visual studio
b.<%{Hi!<%=Html.Encode(page.User.Identity.UName)%>[<%=Html.ActionLi d) Updates the solution
nk("Sign Off","Sign
Off","Account")%>]<%}else{%>[<%=Html.Action.Link("Sign in","Sign 35) On what conditions can you perform concurrent online index operations
in","Account")%>]<%}%> on the same table?
c.<%(user=Authorize){Hi!<%=Html.Encode(page.User.Identity.UName)%>[< a) Creating multiple clustered indexes
%=Html.ActionLink("Sign Off","Sign b) Creating multiple nonclustered indexes----------ans
Off","Account")%>]<%}else{%>[<%=Html.ActionLink("Sign in","Sign c) Reorganizing different indexes on the same table----ans
in","Account")%>]<%}%> d) Reorganizing unique indexes on multiple tables
d.All of the listed options. e) Reorganizing different indexes while rebuilding nonoverlapping indexes
on the same table-----ans
40) Which of the following is Lambda operator?
a) "a" 33) What is Remote Validation?
b) "=>"Ans a) it is a mechanism that can make a remote client call in order to validate a
c) " " form field without passing the entire form to the server
d) "@" b) A mechanism to validate a client machine through remote call
c) A mechanism to validate form field using remote conditions
39.Detatch state is the default state of newly created entity.? d) A mechanism that can make a remote server call in order to validate a
ans:true form field without posting the entire form to the server---Ans
Note:Detached is the default state of a newly created entity because the
context can’t track the creation of any object in your code. 32) Which of the following is the CORRECT option for Model First approach?
a) Generate a Database from a Model------Ans
38) Which statements are true about DENSE_RANK function? b) Generate a Model from the Class
a) Returns the rank of rows within the partition of a result set, without any c) Generate a Model from the Database
gaps in the ranking---------Ans d) Generate a Object from the Model
b) The rank of a row is one plus the number of distinct ranks that come
before the row in question---------Ans 30.In Model We can keep Which of the following:
c) Returns the rank of each row within the partition of a result set
select one or more
a:Business Logic..............ans d.CREATE TRIGGER can apply to multiple tables
b:Data Logic..................ans e.A trigger is created only in the current database;however a trigger
c:Session Logic...............ans can references objects outside the current database---ans
d:Validation Logic............ans
Note:The model is where the domain-specific objects are defined. These 25.Which of the following two are name types of SQL Server Files?
definitions should include business logic (how objects behave and relate), select one or more:
validation logic (what is a valid value for a given object), data logic (how data a: Physical_File_name
objects are persisted) and session logic (tracking user state for the b: Logical_file_name ......................ans
application). c: Primary_File_Name
d: Os_File_Name ...........................ans
29)what is the purpose of NotMapped annotation in entity framework
a)not to create a property for an entity 23)which of the following options are true about temp. stored procedures
b)to remove mapping a property to the data base for an entity..........ans with respect to performance?
c)to add property for a data base entity b:Heavy use of temporary stored procedures can create contention on the
d)none system tables in tempdb and adversely affect performance........ans
Note: You can apply NotMapped attribute to a property which you do NOT c:It is recommended that sp_executesql be used instead....................ans
want to create a column in a database table for. e:sp_executesql discard data in the system tables and therefore avoids the
problem............ans
28.Which of the following arguments of the CREATE TRIGGER statements 22.In entity framework ,Data is retrieved as objects.
specifies true..................ans
the security context under which the trigger is executed.
a)all server 21.What are Entity state members?
b)with encryption select one
c)execute as---ans a:Added
d)instead of b:Deleted
c:Modified
27.By default, LINQ supports which of the following d:All of the listed options..................ans
i.Lazy Loading---ans
ii.Eager Loading 19.Read the following definition and choose the correct option. -->Contains
iii.Deferred Loading methods to create types of objects locally or remotely ,or obtain references
Note:By default LINQ supports lazy to existing remote objects.
loading.(http://www.dotnettricks.com/learn/entityframework/difference- select one
between-lazy-loading-and-eager-loading) a:Activator................ans
b:Validator
26.Which of the following statements are true about trigger c:ModelBinder
creation?(multiple) d:Dependency Resolver
a.CREATE TRIGGER must be the first statements in the batch---ans 18.You need to perform an arithmetic operation in Razor view. which of the
b.CREATE TRIGGER must be the last statements in the batch following will accomplish the task?
c.CREATE TRIGGER can apply to only one table-ans a. "@[value][arithmatic operator][value]"
b. "@;([value][arithmatic operator][value])"
c. "@:([value][arithmatic operator][value])" 12.Which file will conatin the application level configurations?
d. "@([value][arithmatic operator][value])"------ANS select one:
a.Config.config
17.What are the features supported by SQLXML in SQL Server? b.Global.aspx
select one or more c.Web.config..................ans
a. ability to transform the result of a query into XML on the client side -ANS d.Packages.Config
b. ability to create an XML view of relational data bye using an annotated XSD Note:ASP.NET configuration data is stored in XML text files that are each
mapping schema file-ANS named Web.config.
c. ability to access SQL server using HTTP-ANS
d. ability to access SQL server using TCP/IP 11.What does LINQ to SQL do:
e. ability to expose functionality offered by stored procedures, user-defined
functions, and template queries as SOAP-based web services-ANS I.It enables you to query data using Datacontext
II.It provides tightly coupled approach
16. What will be the output of the following code
Public ActionResult Search (string idea="A"){ Select one:
return View(); a.onlt I
} b.only II
I. It will set the default value of String idea to "A" c.both I and IIANS
II. It will set the default pointer of idea to "A" d.neither I or II
Select one: 14) How is a user defined table valued function in select insert update or
a.<% using(Html.BeginForm()){%> <% = Html.AntiLibrary()%> delete statements is invoked?
b.<% using(Html.BeginForm()){%> <% = Html.AntiForgeryToken()%>-----ANS a user defined table valued function can be invoked in the from
c.<% using(Html.BeginForm()){%> <% = Html.AntiCSRFToken()%> clause of a select, insert, update and delete statement-ANS
d.<% using(Html.BeginForm()){%> <% = Html.AntiCSRFLibrary()%> a user defined table valued function can be invoked as a stored
procedure from a select, insert, update and delete statement
5.Analyse the link:-"Http"//localhost/music/".Choose the option which is a user defined table valued function can be invoked in the where
correct for it. clause of a select, insert, update and delete statement
I.Not running under cassini. a user defined table valued function can be invoked in the using
II.Running under IIS. clause of a select, insert, update and delete statement
Select one: 15) Entity framework supports automatic change tracking of the loaded
a.I only entities during the life time of the conext. true---------ANS
b.II only
c.Both I and II ANS 16) Which are the different types of file groups?
d.None of the listed options. Secondary
Primary-------ANS
6.public void TestDate() User-defined--ANS
{ Hidden
Distance z= new Distance();
60)Which of the following are different Securable scopes? 7.What do you mean by eager loading in MVC?
a.Server--------Ans
b.Client I.Related objects(child objects)are loaded automatilly with its parent object.
c.Database-------Ans
II.Related objects(child objects)are not loadede automatically with its parent
object until they are requested. 19.Which of the following option is Correct to turn off lazy loading for all the
entities for BLogging Context? (or) Which of the following statement is TRUE
Select one: to disable lazy loading for all the entities ?
a.I only------ans
b.None select one:
c.Both I and II
d.II only a.public class BloggingContext:DbContext(public BloggingContext () (this
Configuration LazyLoadingEnabled =true;))
12.How are user-defined functions different from User-defined stored
procedures? select one or more: b.public class BloggingContext:DbContext(public BloggingContext () (this
Configuration LazyLoadingEnabled =false;))------ANS
a.In user-defined function the default parameter is specified with a DEFAULT
keyword----ans c.public class BloggingContext:DbContext(public BloggingContext () (this
b.In user-defined function omitting the parameter also implies default value Configuration EnableLazyLoading =false;))
c.User-defined functions do not support output parameters------ans
d.User defined functions do support output parameters d.public class BloggingContext:DbContext(public BloggingContext () (this
Configuration EnableLazyLoading =true;))
16.As a good practice we should put HTML in which of the following?
I.View 20.Which method in MOdelBuilder make sure that entity should have
II.Partial View relationship with other entity? select one:
III.Semi-Partial View
select one: a.Required
b.NeedRelationship
a.I and II----ans c.HasRequired----ans
b.II and III 22.Which of the following are the attributes of
c.I and III System.ComponentModel.DataAnnotations.Schema class?
d.I,II,III
a. Timestamp--------ans
18.What is the difference deterministic & non-determinstic scalar-valued b. Model
function? select one or more c. ConcurrencyCheck-------ans
d. Entity
a. A non-determiinstic function always returns the same result when it is or
called with a specific set of input parameters a. ForeignKey .......................ans
b.A deterministic function always returns the same result when it is called b. Model
with a specific set of input parameters------ans c. Column .......................ans
c.A non-deterministic function always returns the different results when it is d. Entity
called with a specific set of input parameters---ans
d.A deterministic function always returns the different results when it is 24.Which of the following statement is used to fetch an entity using
called with a specific set of input parameters composite key ?
select one:
32.which of the following class provides you important methods to configure
a.Context.MYDbSetTableEntity.Find(key1,key2)---ans entities and its properites to override various code-first conventions?
b.Context.MYDbSetTableEntity.Take(key1,Key2) select one
c.context.MyDbSetTableEntity.Include(key1,key2)
d.context.MyDbSetTableEntity.GetEntity(obj) a.EntityCOntext
b.EntityTypeCOnfiguration----ans
27.Choose the code to show alert on page. c.DBCOntext
select one: d.ObjectContext
a.alert("you have generated an alert box") 34.ObjectCOntext EF v4.0 and DbCOntext EF V4.1 True ---ANS
b.alert("you have generated an alert box");----------ans
c.None 35.There can be one PreApplicationStartMethod per assembly.
d.alert(you have generated an alert box); True-------ans
28.ObjectContext is a class. 36.In COnceptual model,which of the following defines relationship between
state true or False true----------ans two entity types?select one:
29.Using which system Storeprocedure the administrator will register the a.Entity
extended stored procedure DLL to the SQL server? b.Association-----ans
select one: c.Object
d.None
a.sp_ActiveDirectory_obj
b.sp_addextendedproc----------ans 37.Which of the following annontation is to EF that a particular property is
c.sp_addlinkedsrvlogin required ?select one:
d.sp_addlinkedserver a.Needed
b.required-------ans
30.Entity Framework can track changes to the model's objects. c.Unique
True-ans d.Key
FAlse
39.which of the following loads the related data inscalaar and navigation
31.What type of authentication accepts login credentials that will be checked properties along with query result at first shot ? select one :
against the domain or local server and are sent in a hashed format?
select one: a.LAzy Loading
b.Eager Loading-------ans
a.BAsic Authentication c.Explicitly Loading
b.Digest Authentication--------ans d.Dynamic Loading
c.Forms Authentication
d.Windows Authentication 42.which class is used to execute an Entity SQL COmmand against an entity
d.All mode ? select one
51.Choose a unit test to check whether the partcipant A1 has covered half
a.EntityCommand--ans distance of total. Select one:
b.EntityCOnnection a.
c.SqlCOmmand [TestMethod]
d.None {
int total_distance=2;
43.which statement are true about an inline scalar function? int distance_covered=10;
a.There is no functiion body ---ans int distance_left=10;
b.The function body defined in BEGIN ...END block contains a series of T-SQL
statements Disatnce d1=new Distance("A1",total_distance)
c.The scalar value is a result of a single statement ---ans d1.covered(distance_covered);
d.The scalar value is a result of all statements in the BEGIN...END block int left=d1.remaining;
45.To enable globalization ,whcih of the following parameters are set in auto Assert.AreEqual(distance_left,left); ------ans
mode?select one or more: }
b.
a.Languge [TestMethod]
b.Culture------ans {
c.Localization int total_distance=2;
d.Uiculture-----ans int distance_covered=10;
int distance_left=10;
46.which of the following advantage does a strongly typed view have ?
select one: Disatnce d1=new Distance("A1",total_distance)
d1.covered(distance_covered);
a.Run time int Left1=d1.remaining;
b.Intellisense---------ans
c.faster buffering Assert.AreEqual(distance_left.left);
d.loading }
c.
48.The controller class is responsible for the following processing stages:
selct one: [TestMethod]
{
a.Locating the appropriate action method to call and validating that it can be int total_distance=2;
called int distance_covered=10;
b.Getting the values to use as the action method's arguments. int distance_left=10;
c.Handling all errors that might occur during the execution of the action
method Disatnce d1=new Distance("A1",total_distance)
d.All-ans d1.covered(distance_covered);
int Left1=d1@remaining;
Assert.AreEqual(distance_left.left); a)System Data SqlClient -----Ans
} b)System Data ComponentModel
d.All the listed options c)System Data SqlProvider
d)System Data OracleClient
53.What does the following code denote?(not sure )
DECLARE @odetails orderdetails; 2) When you execute user-defined functions that return scalar values, hw are
SELECT @odetails =orderdetais::GetFirstItem(); the parameters specified?
PRINT @odetails.ToString(); a)The argument values are enclosed in paranthesis
b)The argument values are not enclosed in paranthesis-------Ans
Select one or more: c)Parameter names can be specified---Ans
a.It denotes usage of Scope Resolution operator-----ans d)If parameter names are specified,the argument values do not have to be
b.It denotes usage of Compound operator in the same sequence as the parameters.........ANS
c.The operator is denoted by a::symbol-----ans
d.The operator provides access to public non-static memebers of acompind 3) Which libraries are added for XSS provision? Select one or more:
data type a)HTMLSerializationLibrary---Ans
e.The operator provides access to static memebers of a compund data type.- b)CSRFLibrary
----ans c)AntiXSSLibrary-Ans
d)SecurityLibrary-Ans
56.Which of the following model is the design model to include tables,stored
procedures,views,keys and relatonship? Select one: 4.Which statements are true about ranking functions?
a.Mapping
b.Conceptual--ans Select one or more:
c.Storage a.They are deterministic functions
d.None of the listed options. b.They are Non deterministic functions........................ans
c.They return a ranking value for each row in a pattern.........ans
57.Views are used to control placement of_______. Select one: d.They return a ranking value for each table in a pattern
a.Object --ans
b.Property 5. Which statements are true about a multi-statement scalar fuction?
c.data Select one or more:
d.File a.there is no function body,no declaration
b.The function body defined in BEGIN...END block contains a series of T-SQL
58.Which of the following method of the ObjectStateManager is used to get statements...........ans
Object State entry? c.The scalar value is a result of a single statement with multi value.
d.The scalar value is a result of all the statement in the BEGIN..END
Select one: block...........ans
a.TryGetObectStateEntry
b.ChangeObjectState 7.You are given a task by manager to restrict the user to enter the surname
c.GetRelationshipManager which shall not be more than 15 characters.How you will achieve this?
d.ChangeRelationshipState
1) Which namespace is used to include NET data provider for SQL server? Select one:
a. b.It uses the sys.objects catalog
[StringLength(15)] view................................................................ans
public int Sname{get;set;} c.It returns all database objects that have been modified in the last 10 years
b. d.It returns all database objects that have been newly added in the last 10
[StringLength(15)] days................................ans
public string Sname{get;set;} ....................................ans
c. 12.Return only the student name,who are having name as a"Mahesh".
[Length.String.Sname(15)] Which of the following would you choose?
public int Sname{get;set;}
d. Select one:
[Length.String.Sname(15)] a. var query = from stu in Students
public int Sname{} where stu.Name = "Mahesh"
select stu
8) Entity data model considers the business domain => True------Ans b. var query = from stu in Students
where stu.Name = "Mahesh"
9.You are handling page event.Now the content and information you have select Students
cached so that it is loading quickly but you need to keep the clock which shoes c. var query = from stu in Students
time for the event dynamic. where stu.Name == "Mahesh"
Which of the following will be helpful? select stu --------ANS(sure)
d. var query = from stu in Students
Select one: where stu.Name == "Mahesh"
a.<% DateTime(t.now);%> select Students
b.<%Response.writeSubstitution(t=>DateTime.Now.ToLongTimeString());%>
.................ans 13)Match the following
c.<%var c = dynamic.DateTime() %> => Globalization is the process of = Making a product multi------Ans
d.<%session s = new session['Time'];> => Localization is the process of = Adapting a global product for a particular
language and country---Ans
10)Database model provides the normalized schema designed by the
database administrator => True-------Ans 16.JsonResultClass has which of the following syntax?
23___________ cache until DATA IN A SQL SERVER TABLE CHANGES. Select one or more:
a.Rolls back an implicit transaction to the beginning of the transaction,or to a
Select one: savepoint inside the transaction--Ans
a)key dependency b.Rolls back an explicit transaction to the beginning of the transaction,or to a
b)file dependency savepoint inside the transaction--Ans
c)data dependency c.It caches all data modifications&then erases from the start of the
d)SQL dependency...................ans transaction or to a savepoint
d.It erases all data modifications made from the start of the transaction or to
24)what is meant by eagerly loading in entity framework? a savepoint----Ans
Select one: e.It reverses all the modifications made before the COMMIT TRANSACTION
a)eager loading is the process where by a query for one type of entity also statement
loads .................ans
related entities as part of the query 32)Whenever a user searches for a product on the web page,user should get
b)eager loading is the process where by a query for one type of entity also a list of products and only that particular portion of the web page should
loads get updated and the whole page should not be refreshed.Which of the
related entities as part of the query on demand following will help you to achieve this?
c)eager loading is the process of query only the details mapped in the entity
d)none Select one:
a.public ActionResult Index(string query){var c=new ProductContext();var 43.in a conceptual model which of the following are makeup from properties
products=c.ProductSet and define the structure of top-level concepts?
.Where(p=>p.Name.StartsWith(query)||query==null).OrderByDescending(p select one.
=>p.Price).Take(10).Tolist();} a. object
b. database
b.if(Request.IsAjaxRequest()){return c.entity types -------ANS (https://msdn.microsoft.com/en-
PartialView("productTable",products);}return View("Index",products); us/library/ee382840(v=vs.110).aspx)
d. none
c.<%using(Ajax.BeginForm("Index","Product",new
AjaxOptions{HttpMethod="GET",UpdateTargetId="product 46.What are the steps for creating partition tables & indexes?
Table"})){%><input
type="text"name="q"/><input type="submit"value="Search"/><%}%> Select one or more:
a.Create a partiton function to specify how a table or index that uses the
d.All of the listed options--ANS function can be partitioned-ANS
37.WCF means__ b.Create a partiton function to specify the placement of the partitions of a
a. windows communication Farm. partition function on filegroups
b. windows communication Forum c.Create a partiton scheme to specify the placement of the partitions of a
c. windows communication Form-ANS partition function on filegroups---ANS
d. windows communicationFoundation d.Create a partiton scheme to specify how a table or index that uses the
function can be partitioned
38.you are given a task by manager to check whether the given request e.Create a table or index using the partition scheme.--------ANS
routes to the index action of product controller. which of the following
snippets which can be helpfull? 48.How to convert dbContext to object context?
51.How does partition function work? var repository = new Mock <lproductRepository>();
var controller = new ProductController(repositroy.Object);
Select one or more: repository.Setup(p=>p.FIndAll()).Returns(products);
a.A partition function specifies how the table or index is partitioned-------ANS var b = controller.Index().ViewData.Model
b.The function maps the database into a set of partitions. as
c.The function maps the domain into a set of partitions.---ANS IENumerable<Products>Assert.IsTrue(products.SequenceEqual(B));
d.To create a partition function,you must specify the numbers of partitions, }
the partitioning rows & the number of constraints for each partition.----ANS
b.[TestMethod]Public void Product_view_check()
52. Jameson is using a real estate website for Manhattan. He is getting the {
name of builders quickly while for New York it takes time.What property of var products= new LIst<Products>()
caching should be used here? {
Select one: new Product {Title="Samsung"},new Product {Title="Apple"}
a. Use of VaryByParamANS -NOT SURE }.AsQueryable();
b. Use of VaryByCustom
c. VaryByControl var repository = new Mock <lproductRepository>();
d. None var controller = new ProductController(repositroy.Object);
repository.Setup(p=>p.FIndAll()).Returns(products);
var b = controller.Index().ViewData.Model d.var user = context.users.where(b=> b.name=="Vijay".FirstOrDefault();var
as IENumerable<Products>Assert.IsTrue(products.SequenceEqual(b)); subjectCount =
} context.Entry(user).Collection(b=>b.Subjects).Query().Count();-----ANS
c.[TestMethod]Public void Product_view_check() 2..edmx file will create which of the following?
{ select one:
var products= new LIst<Products>()
{ a.Entities & Relationships-------ans
new Product {Title="Samsung"},new Product {Title="Apple"} b.Entities & keys
}.AsQueryable(); c.Entities
d.None
var repository = new Mock <lproductRepository>();
var controller = new ProductController(repositroy.Object); 5.In which of the following the entities and relationships are created on the
repository.Setup(p=>p.FIndAll()).Returns(products); EDMX design surface?
var z = controller.Index().ViewData.Model select one:
as a.Code First Approach
IENumerable<Products>Assert.IsTrue(products.SequenceEqual(z)); b.Model First Approach-------ans
} c.Database Approach
d.none d.None
58.AJAX helper Class exist in which namespace? 8.whenever a user clicks on a product, you have to make sure to ask him/her
select one: whether he/she sure about it or not .which of the following would you choose
a. System.net.MVC select one :
b. System.Web.MVC3
c. System.MVC a.<%=Ajax.ActionLink("Click here","Sample". new AjaxOptions
d. System.Web.MVC----ANS (LoadingElementId="AONE",Question="Are you sure ?", Update
TargetId="ProductAone",})%>
60.which of the following id the correct option to get the related subjects
count without loading it of the student name is"vijay" ? b.<%=Ajax.ActionLink("Click here","Sample". new AjaxOptions
Select one: (LoadingElementId="AONE",Confirm="Are you sure ?", Update
a.var user = context.users.where(b=> b.name=="Vijay".FirstOrDefault();var TargetId="ProductAone",})%>----ans
subjectCount = user.Subjects.Count();
c.<%=Ajax.ActionLink("Click here","Sample". new AjaxOptions
b.var user = context.users.where(b=> b.name=="Vijay".FirstOrDefault();var (LoadingElementId="AONE",Query="Are you sure ?", Update
subjectCount = context.Entry(user).Take(b=>b.Subjects).Query().Count(); TargetId="ProductAone",})%>
55. which of the following class provides you important methods to configure a.Run SQL statements in an Entity framework environment
entities and its properties to override various code first conventions? b.Stores values in the model
select one: c.excute xml data
d.None of the listed options.--ans
a.EntityCOntext
b.EntityTypeCOnfiguration ----ans 8.What is the purpose of key annotation?
c.DBContext
d.ObjectContext Select one:
a.To set the columns as Unique
57.when you are testing the value of variable "a" is not getting set and you b.To set the columns as required
need to have value of "a" before stating of test.How will you solve this error? c.To set the columns as primary key-ans
d.To set the columns as foreign key
select one:
10.Which statement are true about Global Temporary stored procedure?
a."Test.Initialize" public void Initialize() {var a="sometestvalue";}
Select one or more: c.Attach a function to be executed,whenever an AJAX reqest begins and
a.A Global temporary procedure is available to all connections.-----ans there is none already active.---ans
b.A Global temporary procedre is available to all connections with explicit d.Attach a method to be executed,whenever an AJAX reqest begins and there
EXECUTE permission. is none already active.
c.A Global temporary procedure is dropped when the clean-up function is
called by the calling procedure. 23.What does the following Query do?
d.A Global temporary procedure is dropped at the end of the last session
using the procedure.--------ans INSERT INTO docs
e.If a global temporary procedure is created,all users with EXCUTE SELECT 10,xCol FROM (SELECT * FROM OPENROWSET(BULK
permissions can access it & permissions can also be revoked explicitly. 'C:\temp\xmfile.xml',SINGLE_BLOB)AS xCol)AS R(xCol)
15.You want a particular section of your site to be accessed by "Admins" Select one:
only.Which of the following is the correct option to go about it? a.It is typed XML insert statement.
b.Strong XML Data Generated Using FOR XML with TYPE Directive
Select one: c.A new row is inserted into the table named docs-------ans
a.Allow=Admins d.Querying and Modifying XML Data.
b.Access="Admins" Note:The INSERT statement in the following code segment reads the content
c.Authorize(Roles=Admins")---ans of file C:\temp\xmlfile.xml as a BLOB by using OPENROWSET.
d.(Authorize="Admins") A new row is inserted into the table named docs with a value of 10 for
the primary key and the BLOB for the XML column xCol.
17.What will be the order of TDD steps: A well-formedness check occurs when file content is assigned to the XML
I.Write enough code so that it passes the test. column.
II.Write a unit test.
III.Run the test again to watch it pass. 24.Which of the following statements are TRUE?
IV.Watch it fail. I.Multiple entity sets can be defined using the same entity type.
II.An instance of a given type can only exist in one entity set.
Select one: III.The entity key for the instance may not unique within the entity set.
a.II,IV,I,III----------ans
b.III,I,II,IV Select one:
c.IV,I,II,III a.I and II------ans
d.II,I,IV,III b.II and III
c.I and III
19.ajaxStart(callback)-What is the function of this method? d.I,II and III
Note:The entity key for the instance is unique within the entity set.
Select one:
a.Attach a class library to be executed, whenever an AJAX reqest begins and 27.Eager loading is the process of loading related entites/objects.
there is more tahn one active. State True or False. True-------ans
b.Attach a header to be executed,whenever an AJAX reqest begins and there
is none already active. 32.You need to install A but it requires B.In this scenario,what will the Nuget
download?
Select one: 42.Code-First will create the database tables with the name of_________
a.Only A properties in the context class.
b.It will throw an error--------ans(build error will be thrown)
c.A & B Select one:
d.Only B a.Entity
b.Oject
34.In which of the following options, Aggregate functions be used as c.Model
Expressions? d.Dbset----ans
Select one or more:
a.The select list of a SELECT statement(either a subquery or an outer query) - 43.What do you understand by RAW ajax?
--------ans
b.A COMPUTE or COMPUTE BY clause Select one:
c.A GROUP BY clause a.To communicate to business server making the use of "XMLHTTPREQUEST"
d.A HAVING clauseans b.To communicate to database server making the use of "XSLREQUEST"
e.An OVER clause c.To communicate to client server making the use of "XMLHTTPREQUEST"
36.Entity Framework(EF) is an Object/Relational mapping d.To communicate to database server making the use of
State True or False "XMLHTTPREQUEST"--------ans
Select one:
Truetrue 45.HTML helpers Supports the rendering of HTML controls in a view.
False State True or False.
Select one:
39.Commands on console are implemented as powershell command. True---ans
State True or False. False
Select one:
True----------ans 49.We can have more than 1 Web.config file in ASP.NET MVC3
False State true or False
Select one:
40.Which of the following options are CORRECT about entity relationships? True---ans
I.n Entity Framework, an entity can be related to other entities through an False
association(realtionship) Note:By creating web.config file in sub root folders we can use multiple
II.Each relationship contains two ends that describe the entity type and the web.config
multiplicity of the type(one,zero-or-more,or many) files in our application but each folder should contains only one
for the two entites in that relationship. web.config file.
57.What does the Query exeuction plan define? 5) DdContext is just a lightweight version of the ObjectContext class.(TRUE)
Select one or more: 7) How to set maximum length for a column using entity framework?
a.The sequence in which the source tables are accessed.----ans
b.The sequence in which the rows are accessed. a.modelBuilder.SetLength<Entity>().Property(t=>t.Name).HasMaxLength(50
c.The methods used to extract data from each table--ans )
d.The methods used to arrange data from each table. b.modelBuiler.Entity<Entity>().Property(t=>t.Name).HasMaxLength(50)........
..........----.....ans
58.Which of the following line of code will invoke the cart controllers ad c.moderlBuilder.SetMaxLength<Entity>().Property(t=>t.Name).HasMaxLengt
method? h(50)
d. None of the listed options
Select one:
a.return redirect("Cart/Add") 8) Which of the following statements are TRUE?
b.return View("Cart.Add")-----ans
c.return Content("Cart.Add") I. context.Configuration.ProxyCreationEnabled should be true.
d.Response.Redirect("Cart.aspx?Add") II. context.Configuration.LazyLoadingEnabled should be true.
************************************************************** III. Navigation property should be defined as public, virtual. Context will NOT
1) Which of the following is the CORRECT option for getting the user whose do lazy loading if the property is not defined as virtual.
name is "Raja" and to load all the roles related to the user eagerly? a. I,II and III.......................ans
b. II and III
a. var user = context.Users c. I and III
.Where(b => b.Name !="Raja") d. I and II
.Take(b => b.roles) Note:
.FirstOrDefault(); Rules for lazy loading:
context.Configuration.ProxyCreationEnabled should be true.
b. var user = context.Users context.Configuration.LazyLoadingEnabled should be true.
.Where(b => b.Name =="Raja") Navigation property should be defined as public, virtual. Context will NOT do
.Select(b => b.roles) lazy loading if the property is not defined as virtual.
.FirstOrDefault();
9) Entity Framework will support in web services and WCF.
State True or False. {
a. True .......................ans }
b. False }
12) which of the following object is used to track changes, manage entities, a. I,II and III
concurrency and relationship of the entities? b. I and II
c. I and III---ans
a. DbContext d. II and III
b. EntityDataModel....................ans
c. Entity 15) In foreign key association when the relationship changed, the Entity state
d. None of the listed options of the dependent object will change to EntityState.Modified from
EntityState.Unchanged.state True or False
13) DbContxt.ChangeTracker Property Provides access to features of the
context that deal with change tracking of entities. State True or False. a. True.................ans
b. False
a. True................ans
b. False 17) Which of the following is CORRECT for the sql implementation of the
below linq query from s in context.Students from c in s.Courses where
14) Which of the following snippet creates database in local sql express by s.StandardId == 1 select new {s.Student,c}
default?
a. SELECT
I. public class Context: DbContext [Extent1].[StudentId]AS[StudentID],
{ [Extent1].[StudentName]AS[StudentName],
public Context(): base() [Join1].[CourseId1]AS[CourseId],
{ [Join1].[CourseName]As[CouseName],
[Join1].[Location]As[Location],
} [Join1].[TeacherId]AS[TeacherId]
} FROM [dbo].[Student]AS[Extent1]
INNER JOIN
II. public class Context: DbContext (SELECT[Extent2].[StudentId]AS[StudentId],[Extent3].[CourseId]AS[CourseId
{ 1],[Extent3].[CourseName]AS[CourseName],[Extent3].[Location]AS[Location
public Context(): base("DB Name") ],[Extent3].[TeacherId]AS[TeacherId]
} FROM [dbo].[StudentCourse]AS[Extent2]
INNER JOIN[dbo].[Course]AS[Extent3]ON[Extent3].[CourseId] =
} [Extent2].[CourseId] ) AS [Join1]ON[Extent[1].[StudentID] =
} [Join1].[StudentId]
WHERE 1 = [Extent1].[StandardID]
III. public class Context: DbContext
{ b.SELECT
public SchoolDBContext(): base("name=EduDB") [Extent1].[StudentId]AS[StudentID],
[Extent1].[StudentName]AS[StudentName], OUTER JOIN[dbo].[Course]AS[Extent3]ON[Extent3].[CourseId] =
[Join1].[CourseId1]AS[CourseId], [Extent2].[CourseId] ) AS [Join1]ON[Extent[1].[StudentID] =
[Join1].[CourseName]As[CouseName], [Join1].[StudentId]
[Join1].[Location]As[Location], WHERE 1 = [Extent1].[StandardID]
[Join1].[TeacherId]AS[TeacherId]
FROM [dbo].[Student]AS[Extent1]
INNER JOIN 18) Eager loading returns all of the objects including the related objects. State
(SELECT[Extent2].[StudentId]AS[StudentId],[Extent3].[CourseId]AS[CourseId True or False. a. True-ans
1].[Extent3].[CourseName]
[Join1].[CourseId1]AS[CourseId], 20) Which of the following are the benefits of Entity framework?
[Join1].[CourseName]AS[CouseName],
[Join1].[Location]As[Location], a. Mapping manual
[Join1].[TeacherId]AS[TeacherId] b. None of the listed options----------ans
FROM [dbo].[Student]AS[Extent1] c. Auto generate code
INNER JOIN d. Reducing development time
(SELECT[Extent2].[StudentId]AS[StudentId],[Extent3].[CourseId]AS[CourseId 24) By default, the Entity Framework will generate the database queries and
1],[Extent3].[CourseName]AS[CourseName],[Extent3].[Location]AS[Location update commands when your code interacts with the model. State True or
],[Extent3].[TeacherId]AS[TeacherId] False.
FROM [dbo].[StudentCourse]AS[Extent2]
OUTER JOIN[dbo].[Course]AS[Extent3]ON[Extent3].[CourseId] = a. True ................ans
[Extent2].[CourseId] ) AS [Join1]ON[Extent[1].[StudentID] = b. False
[Join1].[StudentId]
WHERE 1 = [Extent1].[StandardID] 25) Which method in the DBContext writes inserts, updates, and deletes to
the data source?
c. None of the listed options
a. SaveChanges.........................ans
d. SELECT b. All of the listed options
[Extent1].[StudentId]AS[StudentID], c. Save
[Extent1].[StudentName]AS[StudentName], d. SaveEntity
[Join1].[CourseId1]AS[CourseId],
[Join1].[CourseName]As[CouseName], 26) After a LINQ to Entities query is converted to command trees and
[Join1].[Location]As[Location], executed, the query results are usually returned as one of the following:
[Join1].[TeacherId]AS[TeacherId] A collection of zero or more typed entity objects or a projection of complex
FROM [dbo].[Student]AS[Extent1] types in the conceptual model.
Group by CLR types supported by the conceptual model.
(SELECT[Extent2].[StudentId]AS[StudentId],[Extent3].[CourseId]AS[CourseId Inline collections.
1],[Extent3].[CourseName]AS[CourseName],[Extent3].[Location]AS[Location Anonymous types.
],[Extent3].[TeacherId]AS[TeacherId]
FROM [dbo].[StudentCourse]AS[Extent2] 27) Which of the following is used to define plain old CLR Objects that are
NoT related to certain persistence technology?
d. NorthwindEntities dbContext = new NorthwindEntities();
a. Persistence Ignorance..............ans Product product = dbContext.ProductSet.Single( p=> p.ProductName ==
b. None of the listed options "Aniseed Syrup");
c. Self-Tracking Entities product.UnitPrice = 1000;
d. Deferred or Lazy Loading dbContext.Save();
28) The DataRelation object is used to add relationship between two 31.which of the following is used to manipulating dataset using linq?
DataTable objects. What are ... Persistence Ignorance - a.LINQ to dataset.....................ans
Facilitates you to define your own Plain Old CLR Objects (POCO) b.none of these
which are independent of any specific persistence technology. c.LINQ TO SQL
d.LINQ TO XML
29) Which of the following class is used to programmatically create
connection string and parse existing connecting string to create attributes 32.a POCO class will not be inherited from entity object class
and methods for the class? state true or false
a.true.....................ans
a. EntityConnectionStringBuilder.................ans 33.database model provides the normalised schema designed by the
b. EntityClientProvider database administrator
c. EntityContext state true or false
d. EntityConnection a. true .................ans
b.false
30) How can we Update UnitPrice of Product?
34.when you use the using statement,then compiler automatically creates a
a. NorthwindEntities dbContext = new NorthwindEntities(); try/finally block and calls dispose in the finally block.
Product product = dbContext.ProductSet.Single( p=> p.ProductName == state true or false
"Aniseed Syrup"); a.true....................ans
product.UnitPrice = 1000; b.false
dbContext.Update(); 35.which of the following property is used to map two seperate types in the
storage model?
b. NorthwindEntities dbContext = new NorthwindEntities(); select one
Product product = dbContext.ProductSet.Single( p=> p.ProductName == a.split entity...................ans
"Aniseed Syrup");............................................ans b.scalar property
product.UnitPrice = 1000; c.association
dbContext.SaveChanges(); d.none of these
c. NorthwindEntities dbContext = new NorthwindEntities(); Note:scalar property:A property of an entity that maps to a single field in the
Product product = dbContext.ProductSet.Single( p=> p.ProductName == storage model
"Aniseed Syrup");
product.UnitPrice = 1000; split entity:An entity type that is mapped to two separate types in the storage
dbContext.UpdateChanges(); model.
36.which namespace is used to include .net data provider for sql server? b.[ignored]
a.system.data.sqlprovider c.[notmapped]..........................ans
b.system.data.oracleclient d.none of these
c.system.data.componentmodel
d.system.data.sqlclient....................ans 43.which of the following statements are TRUE?
I.in an entity framework application data is loaded from the file with the
37.POCO template used to generate which of the following? extension.csdl
select one II.mapping information is publicaly accessible
a.none of these III.the entity framework uses the metadata in the mapping types to translate
b.persistance ignorant modeltypes queries against the conceptual model to data source specific commands
c.persistance ignorant entity types.........................anss select one:
d.persistance ignorant object types
Note: a.II & III
POCO Entities b.I & II
POCO stands for "plain-old" CLR objects which can be used as existing domain c.I.II & III
objects with your data model. d.I & III..............................ans
POCO data classes which are mapped to entities are defined in a data model.
It also supports most of the same query, insert, update, and delete behaviors 45.when a linq entities query is excecuted.
as entity types that are generated by the Entity Data Model tools. select one:
You can use the POCO template to generate persistence-ignorant entity types (ans) a.some expressions in the query might be executed on the server and
from a conceptual model. some parts might be executed locally on the client.client-side evaluaion of an
expression takes place before the query is executed on the
38.entity model support quering only entities defined in entity datamodel server...................ans
state true or false b.some expressions in the query might be executed on the server and some
a. true parts might be executed locally on the server.client-side evaluaion of an
b.false expression takes place before the query is executed on the server.
Note:The Entity Framework even supports mapping entities in the conceptual c.none of these
model to stored procedures in the data source. d.some expressions in the query might be executed on the server and some
parts might be executed locally on the client.server-side evaluaion of an
41.what is the purpose of the system.componentmodel.dataannotation expression takes place before the query is executed on the server.
namespace?
select one
a.none of these 46.which of the following annotation validates property whether it has
b.data first approach to use [key] attribute minimum length of the array or string? (or) Which attribute is used to set
c.code first approach to use [key] attribute...........................ans minimum length for column?
d.model first to use [key] attribute select one:
a.none of these
42.how can we mark properties in the entity framework to be ignored? b.arraylength
select one c.minlength...........................ans
a.[remove] d.lengthofarray
provide us with which of thefollowing attribute to indicate multiple
47.table splitting enables which of the following? relationships
select one:
a.to map two tables to multiples entities select one:
b.to map a single table to multiple entities..........................ans a.onmultiplerelation
c.to map a single entity to multiple tables b.required
d.to map a single schema to multiple entities c.foreign key
d.inverse property.......................ans
48.how can we enable concurrency mode in entity framework?
select one: 55.entity state property is enum type
a.<property name="status" type="byte" nullable="false" state true or false
concurrencymode="true"/> select one:
b.<property name="status" type="byte" nullable="false" a.true.................................ans(may be)
concurrencymode="enabled"/> b.false
c.<property name="status" type="byte" nullable="false"
concurrencymode="yes"/> 56.how can we get objectcontext from DBcontext?
d.<property name="status" type="byte" nullable="false" select one:
concurrencymode="fixed"/>.............................ans a.DBcontext.context
b.DBcontext.getobjectcontext()
50.which of the following is true about overlapping keys? c.none of these
select one: d.((lobjectcontextadaptor)db).objectcontext;.......................ans
a.to change a foreign key association that includes overlapping keys,it is
recommend to modify the foreign key values instead of using the object **************************************************************
references. 1)which data types cannot be return types of scalar function?
b.overlapping keys are composite keys where some properties in the key are a)text-ans
also part of another key in the entity b)ntext-------ans
c.all of these.............................................................ans c)integer
d.you cannot have an overlapping key in an independent association d)image-ans
e)cursor--ans
52.which class is responsible for interacting data as object in the entity
framework? 2)which class provides the rsults by executing command in conceptual
select one: model?
a.entity a)entitydatareader---ans
b.entitycontext b)Dbcontext
c.DBset c)objectcontext
d.DBcontext........................ans d)entityconnection
54.which annotation is used when you have multiple relationships between 3)which of the following is the ability to add and use your own data classes
classes? (Or) which of the following data annotation attribute isuseful when along
you have multiple relationship between two classes (or) Entity Framework with your data model?
a)entityobject only 2
b)dbcontext.context both 1 and 2
c)poco----------ANS none
d)none
11)what are the query considerations for using clustered indexes?
4)razor syntax have intellisense a)use clustered index when a query returns a range of values by using
true or false operators such as between >,>=,<,<=ans
true------ans b)use clustered index when a query returns largs resultsets-----ans
c)use clustered index when a query needs to handle null values
5)how do aggregate functions work? d)use clustered index when a query uses join clauses---ans
a)they work only on integer values e)use clustered index when a query uses group by or order by clausesans
b)they ignore null values-----ans
c)they perform a calculation on a set of values and return a 12)The _______________class supports both linq to entities sql queries
single/summarized value-ans agaimst a conceptual model
d)they frequently used with the group by clause of the select statement------ a)sqlquery
ans b)objectquery--------ans
e)they cannot be used with the group by clause of the select statement c)entitytosql
d)none
6)how does external_access permission set work?
a)allow access only to external assemblies with minimal access to internal 13)TDD uses ________________to drive the design of software?
computation a)red-green-refractor-ANS
b)allows access to internal computations b)unit debug
c)allow access to external system resource such as files,networks and c)unit test
environment variables-----ans d)regression test
d)allow access to registry-----ans
14)which of the followin are true?
8)if we want to create a backward compatible application which of the a)the entity framework lifetime of the context begins when the instance is
following view engine will be preferred in mvc3? created and ends when the instance is either disposed or garbage collected-
a)sparx -ans
b)aspx b)the lifetime of the context begins when the application starts
c)razor------ans c)the primary class that is responsible for interacting with data as objects is
d)Nhaml system.data.entity.dbcontext------ans
d)dB ENTITY PROPERTIES repersent collections of the specified entites in the
10)what will be the output of the following code:- context
public actionresult search(string idea ="a"){
return view(); 15)Nunit have many dependencies ANS:true
}
1)it will set the default value of string idea to "a" 16)what is the significance of the results pane of the query designer?
2)it will set the default pointer of idea to "a" a)it shows a grid with data retrieved by the query or view-ans
only 1----------ANS b)it shows the results of the most recently executed select query---------ans
c)it shows the query syntax II.which declares a conceptual model,storage model and mapping between
d)you can modify the database by editing values in the cells of the grid------ these models
ans III.It divided into three categorieS SSDL,CSDL and MSL
e)you can add or delete rows--ans
Select one:
18)what should be tested a controller? a.I and II
1)proper actionresult are returned or not b. II and III
2)proper model are build or not c. I and III
d.I,II and III--ANS
A)2 ONLY
B)BOTH 26.You dont want to allow anyone to do any change to the code being
C)NONE deployed on
D)1 ONLY-ANS production server.what will be the solution?
a.Uncheck "Allow this precompiled site to update" under Output Assemblies-
20)i have a table blog which i want to split into two blog.which of the followin ->Compilation-ANS
is the correct snippet? b.Uncheck "Allow this precompiled site to update" under configuration--
a)protected override void OnModelCreating(DbModelBuilder >Compilation
modelBuilder){modelBuilder.Entity<Blog>().HasRequired(e=>e.BlogAbout). c.Uncheck "Allow this precompiled site to update" under signing--
WithRequiredPrincipal();modelBuilder.Entity<Blog>().ToTable("Blogs");mod >Compilation
elBuilder.Entity<BlogAbout>().ToTable("Blogs");} d.Uncheck "Allow this precompiled site to update" under deployment--
b)protected override void OnModelCreating(DbModelBuilder >Compilation
modelBuilder){modelBuilder.Entity<Blog>().ToTable("Blogs");modelBuilder.
Entity<BlogAbout>().ToTable("Blogs");}----ANS 27.You have a certain number of products with price ranging from high to low
c)protected override void OnModelCreating(DbModelBuilder to medium. You
modelBuilder){modelBuilder.Entity<Blog>().HasRequired(e=>e.BlogAbout). want to filter products by their respective price range.Which of the following
WithRequiredPrincipal();} option
d)protected override void OnModelCreating(DbModelBuilder will fulfill this conditions?
modelBuilder){modelBuilder.Entity<Blog>().HasRequired(e=>e.BlogAbout)m a.[...
odelBuilder.Entity<Blog>().ToTable("Blogs");modelBuilder.Entity<BlogAbout @using(Html.BeginForm("index","Range"))
>().ToTable("Blogs");} {
Html.DropDownList("Product",new selectList(viewBag.Ranges))
21.----improves the performance of ASP.NET MVC application drastically. <input type="submit" value="filter"/>
a.Output profiling }
b.Output Regeneration ...]
c.Output updation
d.output caching-----ans b.[...
@using(Html.BeginForm("index","Product"))
25.Which of the following statements are TRUE?(MULTIPLE ANS) {
I.edmx file is an XML.file Html.DropDownList("Range",new selectList(viewBag.Ranges))
<input type="password" value="filter"/>
} 33.choose a unit test to check whether the participant A1 has covered half
...] the ditance of total
a.[TestMethod]
c.[... {
@using(Html.BeginForm("index","Product")) int total_distance=2;
{ int distance_covered=10;
Html.DropDownList("Range",new selectList(viewKnapsack.Ranges)) int distance_left=10;
<input type="submit" value="filter"/> Distance d1=new Distance("A1",total_distance); ----ans
} d1.covered(distance_covered);
...] int Left=d1.remaining;
Q.51 How can we insert Products with new Category? Q.58 Do we have a console option in the Nuget?
a NorthwindEntities dbContext = new NorthwindEntities();("same a Maybe
everywhere only last line changes")dbContext.SaveChanges();--------ans b Yes--------ans
c no a.from s in ctx.Blogs groupby s.BlogName ascending select s;
d None of the listed options b.from s in ctx.Blogs orderby s.BlogName ascending select s;--------ANS
c.from s in ctx.Blogs where s.BlogName ascending select s;
Q.59 Find the object query methods from the following d.None
a Distinct
b Except 8.The_________ class provides facilites for querying and working with entity
c GroupBy data as objects,keeping track of the entity objects, along with the state
d All of the listed options--------ans information (added,modified,deleted) and the ability to update entities and
************************************************************* write changes back to the database.
1.You need to look up in the database for validation . what kind of validation select one:
it is ?
a.DbContext
I.remote b.DataContext
II.Self c.ObjectContext-ANS
select one : d.None
2.what is the significance of clr enabled option ? b.You can control which user account the databse engine uses to validate
select one or more: permissions on any objects that are referenced by the module.
c.It provides additional flexibilty and control in managing permissions across
a.It is used to specify whether user assembles can be run by SQL Server the object chain that exsists between user-defined modules and the objects
b. The clr enabled option can be set to value FALSE to denote that assembly referenced by those modules.
execution is not allowed on SQL SErVER
c.The clr enabled option can be set to value TRUE to denote that assembly d.Users of the module only need permissions to execute the module
execution is allowed on SQL SErVER itself;explicit permissions on the refernced objects are not required.
d.The clr enabled option can be set to value 0 to denote that assembly
execution is not allowed on SQL SErVER e.Users of the module need explicit permissions on the referenced objects
e.The clr enabled option can be set to value 1 to denote that assembly thereby making it more secure.
execution is not allowed on SQL SErVER
ANS----------b,c,d
ANS-------a,d,e
12.Entity Framework 4.1 permits accessing which of the following properties?
3.Which of the following option is correct to get the blog details details by I.Database Value
order it ascending based on OrderName ? II.original Value
Select one : III.XML Value
select one:
d.Generate a object from the Model
a.I and II only-------ANS
b.II and III only 24.Which are the different types of Windows -level principals ?
C.I and III only Select one or more:
d.I,II and III
a.Windows Authorization
14.Consider,you have to update the page asynchronously using b.Windows Domain Login-------ANS
Ajax.BeginForm method with Action "Act" ,Home controller "HO" & the id to c.Windows Database Login
update is "up" . d.Windows local login---------ANS
which of the following would you choose ? 25.what does the SELECT statement define ?. select one or more:
Select one:
a. The format of the database.
a. "@using (Ajax.BeginForm("HO" ,"Act", b.The format opf the result set.This is specified modify in the select list.
new AjaxOptions[HttpMethod ="GET" , c.The tables that contain the source data.This is specified in the FROM clause.
InsertionMode=InsertionMode.Replace, d.How the tables are logically related for the purpose of the SELECT
UpdateTargetid="up"}))" statement . This is defined in the join specifications,which may appear in the
WHERE clause or in an ON Clause following FROM.
b. "@using (Ajax.BeginForm("HO" ,"Act", e.The conditions that the rows in the source tables must satisfy to quality for
new AjaxOptions{HttpMethod ="GET" , the SELECT Statement.These are specified in the WHERE and HAVING clauses.
InsertionMode=InsertionMode.Replace,
UpdateTargetid=""}))" ANS-b,c,d,e
c."@using (Ajax.BeginForm("Act" ,"HO",
new AjaxOptions{HttpMethod ="GET" ,-------Ans 29.nunit-console exe shows output on console. => True--ANS
InsertionMode=InsertionMode.Replace,
UpdateTargetid="up"}))" 31.How are user-defined functions different from user- defined stored
procedures ? select one or more :
d."@using (Ajax.BeginForm("HO" ,"Act",
new AjaxOptions{HttpMethod ="GET" , a.IN user- defined function the default parameter is specified wiwth a
InsertionMode=InsertionMode.Replace, DEFAULT keyword.
UpdateTargetid="up"}))" b.In user-defined function omitting the parameter also implies default value
c.User-defined functions do not support output parameters
17.Entity framework may support composite keys. => TRue-----ANS d.user-defined functions do support output parameters.
21.which of the following is the Correct options for Database First approach 34.How are stored procedure similar to procedures developed in other
?Select one : programming languages ? select one or more:
a.Generate a database from the Model a.Accept input paramaters and return mulitiple values in the form of output
b.Generate a Model from the Class parameters in the calling procedures or batch
c.Generate a Model from the Database---------ANS
b.Contain prograaming statements that perform operations in the
database including calling the other procedures a.I and II
c.Return a status value to a calling procedure or batch to indicate success b.I and III
or failure c.II and III
d.Can be interpreted externally . d.I,II, and III.ANS
45.You have to create a view model which will show a cricket player's 50.[ActionName("search")]
name,team name, wickets taken ,runs scored about and his rank. public ActionResult GetBySname(string Sname)
which of the following should you choose? select one: {
//get song name from the database
a.Public class PlayerInfoModel { public string.TeamName {get;set} public return View();
string.Name {get;set} public int.wickets {get;set} }-Analyse at the code & choose
public int.Runs{get;set} public int.Rank {get;set} } Which of the following will invoke the above mentioned method?
Select one:
b.Public class PlayerInfoModel { public string TeamName() public string
Name() public int wickets() a.http://localhost/songs/GetBySname/post=lblame?
public int Runs() public int.Rank() } b.http://localhost/songs/search/blame-------ANS
c.http://localhost/songs/GetBySname/blame
c.Public class PlayerInfoModel { TeamName {get;set} Name {get;set} wickets d.http://localhost/songs/search/post=lblame?
{get;set}
Runs{get;set} Rank {get;set} } 53.Which of the following Code will help us to use the table valued functions
"GetStudentList" and will retrieve all the course details of all students from
d.Public class PlayerInfoModel { public string TeamName {get;set} public "City1" in Entity Framework ? select one:
string Name {get;set} public int wickets {get;set}
public int Runs{get;set} public int Rank {get;set} }------ANS a.using (var ctx = new SchoolDBEntities()) { //Execute TVF and filter result
var courseList = ctx.GetStudentList(1)
48.We can access data in view using________ Where(c =>c.location =="City1").ToList<GetCourseList>();
select one foreach (GetStudentList cs in courseList)
COnsole.WriteLine("Course Name:(0), Course Location:(1)",
a.View@Data cs.CourseName,cs.Location);)--------ANS
b.View Data
c.ViewData--------ANS b.using (var ctx = new SchoolDBEntities()) { //Execute TVF and filter result var
d.View_Data courseList = ctx.GetStudentList(1)
Where(c.location =="City1").ToList<GetCourseList>();
49. Which of the following are the three parts of ENtity Framework ? foreach (GetStudentList cs in courseList)
COnsole.WriteLine("Course Name:(0), Course
I.DOmain Class Object Location:(1)",cs.CourseName,cs.Location);)
II.Relational Database
III.Object and Mapping information c.using (var ctx = new SchoolDBEntities()) { //Execute TVF and filter result var
select one: courseList = ctx.GetStudentList(1)
Where(c => c.location =="City1").ToList<GetCourseList>();
foreach (GetCourseList cs in courseList) 57.DbCOntext() method Constructs a new context instance using conventions
COnsole.WriteLine("Course Name:(0), Course to create the name of the database. True--Ans
Location:(1)",cs.CourseName,cs.Location);)
1)Can you convert a Nonpartitioned Table to Partitioned Table?If
d.using (var ctx = new SchoolDBEntities()) { //Execute TVF and filter result var yes,how?Choose all that apply.
courseList = ctx.GetStudentList(1)
In(c => c.location =="City1").ToList<GetCourseList>(); Select one:
foreach (GetCourseList cs in courseList) a.By creating a partitioned non-clustered index on the table by using the
COnsole.WriteLine("Course Name:(0), Course CREATE INDEX statement
Location:(1)",cs.CourseName,cs.Location);) b.By creating a partitioned clustered index on the table by using CREATE
INDEX statement-------ANS
54.Entity Framework has in-memory copy of the original values and uses this c.By using the ALTER TABLE SWITCH statement to switch the data of the table
for working out what has changed. True---ANS to a range-partitioned table has only one
partition-------ANS
55.IClientValidation GetClientValidation d.By using the ALTER TABLE SWITCH statement to switch the data of the table
{ to a range-indexed table that has a unique partition.
var z =new ModelClientValidationRule(); e.You cannot convert a Nonpartitioned Table to Partitioned Table.
z.ErrorMessage = FormatErrorMessage(metadata.GEtDisplayName());
2)Which of the following is the query product by Categoryname?
z.ValidationType ="compare";
z.validationparameters.Add("sample",SamplePropertyName); Select one:
yield return z; a.NorthwindEntities dbContext = new NorthwindEntities();var query =from p
} in dbContext.ProductSet where p.Categories.CategoryName == "Seafood"
----Analyse the code and identity which of the following statement is true ? select p;IEnumerable<Product>product = query;
b.NorthwindEntities dbContext = new NorthwindEntities();var query =from
select one : p in dbContext.ProductSet where p.Categories.CategoryName == "Seafood"
select p;IEnumerable<Product>product = query.ToList();-------ANS
a.None c.NorthwindEntities dbContext = new NorthwindEntities();var query =from p
b.Client side custom validation of custom type="compare"---------ANS in dbContext.ProductSet where p.Categories.CategoryName == "Seafood"
c.Performs remote validation to compare to compare two properties and select p;IEnumerable<Product>product = query.ToArray();
shows and error message if not equal d.NorthwindEntities dbContext = new NorthwindEntities();var query =from p
d.Server side validation for custom property and error message. in dbContext.ProductSet where p.Categories.CategoryName == "Seafood"
select p;IEnumerable<Product>product = query.ToString();
56.To return a string literal , which method is used ?Select one :
3)How are the transaction locks acquired by a SELECT statement controlled?
a.Call
b.String-----ANS Select one or more:
c.Literal a.Controlled by the transaction concurrency setting for the connection.
d.Content
b.Controlled by the transaction isolation level setting for the connection.----- b.II and III
--ANS c.I and III
c.Controlled by any locking hints specified in the WHERE clause. d.I,II and III-------ANS
d.Controlled by any locking hints specified in the FROM clause.-------ANS
11)What are the different types of development approaches in EF?
5)Ashley Is new to developing and the manager has told her to make the form
advance by selecting date.How will Ashley achieve this? Select one:
a.Code First
Select one: b.Model First Approach
a.$(add).datepicker(); c.Database first
b.$(generate).datepicker(); d.All of the listed options-------ANS
c.$(".create#ProductDate").datepicker();
d.$(".attach#ProductionDate").datepicker();-------ANS 13)AreEqual(Object,Oject)-what does this method do when used with assert?
6)EF supports multiple modeling technique. State true or false Select one:
a.Verifies that three specified objects are equal
7)How to remove dependencies? b.Verifies that two specified objects are equal-------ANS
Select one: c.All the listed options
a.Uninstall-package packageName-RemoveDepencies-------ANS d.Verifies that two specified objects are not equal
b.All the listed options
c.Remove-Dependencies 14)Scott wants to mark an action method to cache the output.Which class
d.Delete Depencies will Scott use?
15) ________________ occurs when you need to point to another data object select one or more:
from one data object. a. Both I and II--ans
b. II only
select one: c. none
a. int data type d. I only
b. string data type
c. float data type 2.which attribute is used to set complex type in entity framework annotations
d. complex data type---ANS
select one:
a. ComplexType-----ans 6.in TDD, we develop the code first which is then followed by testing
b. MaxLength b. false------ans
c. Key
d. ComplextypeColumn 7. we set IsSynchronizedWithCurrentItem property of the objects list box to
true. that way every time you change the selection in the listbox the current
3.what happens if the SCHEMABINDING option is used in CREATE FUNCTION item in the colectionviewsource is updated.
statement a. true-----ans
select one or more:
a. the user-defined function cannot be deleted unless the database is 8.what are the isolation semantics for FILESTREAM storage ?
dropped
b. the user-defined function cannot be modified unless the database is select one or more:
dropped a. the isolation semantics are governed by database engine transaction
c. the database objects that the function references cannot be altered or isolation levels-----ans
dropped unless the function is dropped first---ans
d. the database objects that the function references cannot be altered or b. when the FILESTREAM data is accessed through the win32 APIs,read-
dropped unless the schema binding of the committed,repeatable-read and serializable
function is removed---ans isolation levels are supported
Note:If a function is created with the SCHEMABINDING option, c. when the FILESTREAM data is accessed through the win32 APIs,only read-
then the database objects that the function references cannot be altered or committed level is supported---------ans
dropped unless the function is dropped first,
or the function is altered and the SCHEMABINDING option is not specified. d. when the FILESTREAM data is accessed through Transact-SQL,only read-
committed level is supported
4.which of the following T-SQL statement are not allowed in DML trigger
e. when the FILESTREAM data is accessed through Transact-SQL,read-
select one or more: committed,repeatable-read and serializable
a. ALTER DATABASE----ans isolation levels are supported----ans
b. LOAD DATABASE----ans
c. CREATE 9. IOC stands for inversion of constraint
d. UPDATE b. false---------ans(Inversion of Control)
e. CREATE DATABASE---ans
10.marry jane is creating a page for songs feedback. the mapping should be
5.you want to prevent your feedback from XSS. which of the following is valid done in such way that one song can have more
option to do it ? than one feedback as many as users will be providing the feedback. which of
select one: the following option will help her accomplish
a. feedback .Body=Sanitizer.GetSafeHtmlFragment(feedback@Body); her task ?
b. feedback .Body=Sanitizer.GetSafeHtml(feedback.Body);
c. feedback .Body=Sanitizer@GetSafeHtmlFragment(feedback.Body); select one:
d. feedback .Body=Sanitizer.GetSafeHtmlFragment(feedback.Body);----ans a. ModelBuilder.Entity<Song>()
.HasMany(song=>song.feedbacks) d. T-SQL statements in the TRY block that follow the statement that
.WithRequired(feedback=>feedback.Song);----ans generated the error are not executed--ans
24.The entity framework uses mapping metadata to translate queries against 38.Which of the following is TRUE about entity set
the conceptual model storing specific commands. select one:
state true or false a.An entity is a logical container for instances of an entity type and instances
a.true----------ANS of any type derived from that type
b.An entity set is defined within an entity container which is logical grouping
of entity sets and association
c.the type of the instance is either same as entity type on which the entity set
is based or type of instanceis subtype of entity type
d.all above listed----------ANS
43.myDBContextEntity(staffentity).References(s=>s.subjects).load()indicates
which of the following
select one:
a.lazy loading
b.explicit loading-------ANS
c.database loading
d.object loading
44.we can insert data into your databse tables during database initialization
process => a.true-----ANS
52.which method is used to get the entity based on composite keys in entity
framework?
select one:
a.load
b.find---ANS
c.include
d.take