我在api控制器中发送邮件请求使用邮递员我尝试了两种方式首先我使用viewmodel我得到了空值我之后我使用jObject作为收到的参数发布它获取值但当我尝试转换时将它重视为对象,它没有通过异常......我的代码......
public async Task<IHttpActionResult> PostCommunityAsync(JObject json_obj)
{
dynamic jsondata = json_obj;//In this get recieve value there
JObject com = jsondata.Community;//gets null com contains null after
the breakpoint hit...Community is my MOdel class//
var commu = com.ToObject<Community>();
var community = commu.ToObject<Community>();//through null referene
exception//
await _as.abc(commu);
return Ok();
}