- Code: Select all
[DataContract]
public class Customer
{
[DataMember(Name="first_name")]
public string FirstName { get; set; }
[DataMember(Name="last_name")]
public string LastName { get; set; }
}
[DataContract]
public class Customer
{
[DataMember(Name="first_name")]
public string FirstName { get; set; }
[DataMember(Name="last_name")]
public string LastName { get; set; }
}
SBarnes wrote:Your other option would be to annotate your DTO classes
iamgurney wrote:okay. By the way even if I not use Newtonsoft but due to newtonsoft attribute in models I need to put the reference of it so why its saying Newtonsoft could not be load. Do I need to remove all attributes from models ?
ServiceStack.Text.JsConfig<JiwaFinancials.Jiwa.JiwaServiceModel.Startup.Diagnostics.StartupLogEntry>.SerializeFn = input =>
{
return Newtonsoft.Json.JsonConvert.SerializeObject(input);
};
SBarnes wrote:The following link may also be of help https://forums.servicestack.net/t/how-t ... stack/5152 where you can override the toJson method on the DTO, you could always use inheritance and create the method in one spot namely the parent class.
SBarnes wrote:The following link may also be of help https://forums.servicestack.net/t/how-t ... stack/5152 where you can override the toJson method on the DTO, you could always use inheritance and create the method in one spot namely the parent class.
This gives you access to the IHttpRequest object letting you parse it manually so you can construct and return the strong-typed Request DTO manually which will be passed to the service instead.
Return to Technical and or Programming
Users browsing this forum: No registered users and 16 guests