The result I am getting
falsef005fdc9-7781-4c75-9f54-0a05a7fc6e71bc3d0990-2f44-491f-a25a-3771772d6a61false2017-10-10T08:43:16.0831010019false
I am getting like the format as below when I use the postman.
[]
? I tried to remove ToList()
but it didn't work.controller method
public IEnumerable<ClientModel> GetClients()
{
var clients = ClientHelper.GetAllClients();
var result = (from c in clients
select c).ToList();
return Mapper.Map<IEnumerable<ClientModel>>(result);
}
Use this namespace
using System.Web.Script.Serialization;
and
var json_result = new JavaScriptSerializer().Serialize(result );
You must get json data in json_result
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.