[ServiceContract(Namespace="")] public interface IService1 { [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat=WebMessageFormat.Json,UriTemplate="/SaveUserData")] string SaveUserData(NameValuePairs nvps); } [DataContract] public class NameValuePair { [DataMember] public string name_obj { get; set; } [DataMember] public string value_obj { get; set; } } [CollectionDataContract(Namespace = "")] public class NameValuePairs : List<NameValuePair> { public NameValuePairs() { } }
public class Service1 : IService1 { public string SaveUserData(NameValuePairs nvps) { var columns = new StringBuilder(); var parameters = new StringBuilder(); string abc = "EMPTY SWEET"; foreach (NameValuePair nvp in nvps) { abc = nvp.name_obj + " | " + nvp.value_obj; } return abc; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)