我需要记录WCF服务中的每个方法调用以及抛出的所有异常。这导致了很多冗余代码,因为每个方法都需要包含类似于这样的样板文件:[OperationContract]publicResultBaseAdd(intx,inty){varparameters=newobject[]{x,y}MyInfrastructure.LogStart("Add",parameters);try{//actualmethodbodygoeshere}catch(Exceptionex){MyInfrastructure.LogError("Add",parameters,ex);returnnewResul