0
我说这个。但是我的API部门conrtoller当我运行它的网站上说,它没有找到,我不熟悉C#与做任何帮助..没有HTTP资源被发现
[HttpDelete]
[AcceptVerbs("Delete")]
[ResponseType(typeof(Department))]
public override async Task<IHttpActionResult> Delete(Department tObj, bool? tagAsDeleteOnly)
{
_bll.Delete(tObj, tagAsDeleteOnly ?? true);
var result = await _bll.Save();
return Ok(new WebResult
{
Data = tObj,
Total = (int)result,
Result = result > 0
});
}
的错误说
{
"Message": "No HTTP resource was found that matches the request URI 'http://localhost:8933/api/Department/Delete'.",
"MessageDetail": "No action was found on the controller 'Department' that matches the request."
}
这是我传递 what i pass picture
这是我在我的前端
代码delete(form) {
debugger
form.State = 2;
let id = form.Key;
//delete form.Key;
this.props.deleter('department/Delete', form);
}
,然后继续
export const deleter = (url, params) => {
return(dispatch, getState, api) => {
api += 'api/';
return fetch(`${api}${url}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
.then(response => response.json())
.then(result => dispatch(departmentResult(result, types.DELETER)));
}
}
由[HttpDelete]属性指定的是您确实发送删除请求验证这一点? –
怎么办你通过'部门'对象? –
我不知道你的意思是,但..即时通讯发送项目'api/Department/Delete'' @AlanBuchanan – LAGIM