开发者

How can i add contract attributes programaticly?

i have pure an interface like below

public interface IPure
{
  Array GetEmployee(int employeeId);
  DataSet GetAllProd开发者_开发百科ucts();
  List<string> GetAllSubCategoryNames();
  double AverageSubTotalFromHeaders();
}

How can i add contract attributes programaticly my interface at runtime?


You can't. Attributes are declarative, not imperative.

You can affect the service host at run time, when you configure it, but that's just moving the information from the configuration file to your code.


Maybe TypeDescriptor.AddAttributes could help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜