Answer: If the user has a service which is used by many clients out of their control.
If Some operations, didn’t make sense , so if we wanted to deprecate those operations, preventing new clients from using them and also didn’t want to break existing clients, hence we couldn’t simply remove the operations, we can use attribute, which would remove the operation from the metadata, but not from the runtime, we can use
ServiceMetadataContractBehavior attribute to achieve this..
Eg.
[ServiceContract]
[DeprecatedOperationsWsdlExportExtension]
public interface ICalculator
{
[OperationContract]
int Add(int x, int y);
[OperationContract]
[DeprecatedOperation]
int Divide(int x, int y);
}
Asked In: Many Interviews |
Alert Moderator