Service Bus Property Promotion Nuget Package
I have just published a Nuget package which adds property promotion features to Service Bus WCF programing model.
Once you added the package to your project you can use the PromotedProperty attribute to mark your properties as promoted. The package supports promotion from both complex & primitive arguments. In addition to PromotedPropertyAttribute you also need to stick PropertyPromotionBehavior on each method of your service contract.
Following service contract captures the sample usage.
- public class Order
- {
- public double Amount { get; set; }
- [PromotedProperty]
- public string ShipCity { get; set; }
- }
- [ServiceContract]
- public interface IOrderService
- {
- [OperationContract(Name = "SubmitFlat", IsOneWay = true)]
- [PropertyPromotionBehavior]
- void Submit(double amount, [PromotedProperty] string shipCity);
- [OperationContract(IsOneWay = true)]
- [PropertyPromotionBehavior]
- void Submit(Order order);
- }
Enjoy…