Cannot convert expression type SystemCollectionsGenericICollectionint to return type MicrosoftAspNetCoreMvcActionResultSystemCollectionsGenericICollectionint
This error occurs when there is a mismatch between the return type of a method and the type of the expression being returned. In this case, it seems that the method is expected to return an ActionResult of type ICollection
To fix this error, you can wrap the ICollection
public ActionResult<ICollection<int>> MyMethod()
{
ICollection<int> myCollection = GetMyCollection();
return Ok(myCollection);
}
This should convert the ICollection
原文地址: https://www.cveoy.top/t/topic/haqT 著作权归作者所有。请勿转载和采集!