开发者

How can i add contract attributes programaticly?

开发者 https://www.devze.com 2022-12-14 01:21 出处:网络
i have pure an interface like below public interface IPure { Array GetEmployee(int employeeId); DataSet GetAllProd开发者_开发百科ucts();

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

精彩评论

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

关注公众号