Greetings to everyone and always thanking you for your help, I am developing a RestApi application in the .NET Framework 4.8 on the C# language and for this I need to respond in my response from my service a text that includes double quotes, this text comes from the database.
Text: {"title": "Dear User", "content": "You currently have no information."}
I have made a replace to be able to solve it but I have not obtained a response that shows me the same message that is found in the database.
Hope I get help on this topic
Text: {"title": "Dear User", "content": "You currently have no information."}
DTO:
///DTO db y de salida
public class ParametroDto
{
public ParametroDto() { }
public string codParametro { get; set; }
public string glsParametro { get; set; }
public string valParametro{get; set; }
}
I have made a replace to be able to solve it but I have not obtained a response that shows me the same message that is found in the database.
Response service:
if (_consulta == null)
{
List<ParametroDto> mensaje = ServiceConsultaSeguro.Instance.ConsultaSeguroParametro("SININF");
consulta.mensaje = new List<ParametroDto>();
foreach (ParametroDto parametro in mensaje)
{
parametro.valParametro = "$" + parametro.valParametro.Replace("\\\\"," ");
//parametro.valParametro = parametro.valParametro.Replace(@"\\", "");
consulta.mensaje.Add(parametro);
}
return consulta;
}
consulta.seguros = consultaSeguro;
Hope I get help on this topic