CTG Rest API with SQL database. Return JSON
2 USDЯ работаю над REST API SQL database. По условиям - должен возвращать JSON. У меня возвращается строка с RAW JSON as string : "{\"status\":100,\"Result\":{\"TripID\":\"182\",\"UniqueId\":\"1825144822\"},\"msg\":\"success\"}"
Мой Return не принимается.
Applications 3
-
если этот контроллер наследуется от ApiController
вместо string сделай тип возврата AccountReturn и возвращай его экземпляр без сериализации
-
Спасибо что откликнулись
Та сторона, которая делает POST - это готовый проект который они не хотят переделывать.
Я пробовала найти компромис но они на него не идут. Даже простое изменение.
Насчет AccountReturn - когда я пытаюсь вернуть AccountReturn- получаю "Cannot implicitly convert type AccountReturn to "String"Перепробовала 100 вариантов - не получается. Возвращается строка с
Raw JSON. Не получается сменить формат. Получаю errorГотова передать весь проект для проверки - возможно я где то допустила ошибку
Скажите ваши условия -
Насчет AccountReturn - когда я пытаюсь вернуть AccountReturn- получаю "Cannot implicitly convert type AccountReturn to "String"
сделай объявление метода не
public string Post(...)
а
public AccountType Post(...)
-
извини
не AccountType а AccountReturn
-
Current freelance projects in the category C#
Improvement in the existing version of 1C retail block for the distribution center (DC)In general, I will explain what kind of database we have - There is a main server where there is a retail database (where all receipts are recorded) - a UTP database - where all sales are transferred - it calculates the markup and stock balances - small databases of retail… C & C++, C# ∙ 3 days 22 hours back ∙ 6 proposals |
It is necessary to migrate the current working program from FoxPro to C#.Hello everyone! We have a program in FoxPro (it has several modules, it's an accounting program), we have the source code of the program, and if necessary, we can consult with people who support the current program. What needs to be done: 1. Analyze how everything works,… C#, Desktop Apps ∙ 6 days 12 hours back ∙ 18 proposals |
Junior C#We are looking for a talented and ambitious Junior C# developer who is eager for professional growth and new challenges. Your future tasks: - Development and support of backend solutions with frontend (Telegram bot); - Automation of routine processes in Android development,… C# ∙ 7 days 3 hours back ∙ 8 proposals |