How to make nullable properties, fields on C# for a webservice?.

  • 16 August 2016
  • 1 reply
  • 3 views

Badge +4

HI All,


 


I have a web service with some properties developed in C# but when I create my Webservice Service Instance the smartobjects properties are set as Required. Is there a wat to make them null or nor required?.


 


This is an example of my defition in C#:


 


public List<Schema> CreateListItems(string Prop1, string Prop2, string Prop3)


 


Thanks !!!


1 reply

Userlevel 1
Badge +8

Hi MrBlue

 

You can try making your parameters nullable (e.g. string? Prop1) but I'm not sure that will do the trick.

 

Another option to look at is overloading your method (provided you can tell at runtime which parameters are going to be nulls).

Reply