Which code segment should you use in the Initialize method?

You are developing a WCF data service that will expose an existing Entity Data Model (EDM). You
have the following requirements:
• Users must be able to read all entities that are exposed in the EDM.
• Users must be able to update or replace the SalesOrderHeader entities.
• Users must be prevented from inserting or deleting the SalesOrderHeader entities
You need to ensure that the data service meets the requirements.
Which code segment should you use in the Initialize method?

You are developing a WCF data service that will expose an existing Entity Data Model (EDM). You
have the following requirements:
• Users must be able to read all entities that are exposed in the EDM.
• Users must be able to update or replace the SalesOrderHeader entities.
• Users must be prevented from inserting or deleting the SalesOrderHeader entities
You need to ensure that the data service meets the requirements.
Which code segment should you use in the Initialize method?

A.
config.SetEntitySetAccessRule(“*”, EntitySetRights.AllRead);
config.SetEntitySetAccessRule (“SalesOrderHeader”,
EntitySetRights.AllWrite);

B.
config.SetEntitySetAccessRule(“*”, EntitySetRights.AllRead);
config.SetEntitySetAccessRule (“SalesOrderHeader”, EntitySetRights.WriteMerge |
EntitySetRights.WriteReplace);

C.
config.SetEntitySetAccessRule(“*”, EntitySetRights.AllRead);
config.SetEntitySetAccessRule (“SalesOrderHeader”, EntitySetRights.WriteAppend |

EntitySetRights.WriteDelete);

D.
config.SetEntitySetAccessRule(“*”, EntitySetRights.AllRead);
config.SetEntitySetAccessRule (“SalesOrderHeader”,
EntitySetRights.All);

Explanation:
http://msdn.microsoft.com/en-us/library/system.data.services.entitysetrights.aspx
http://msdn.microsoft.com/en-us/library/ee358710.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *