T를 매개 변수로 전달하고 있으며이 빌드 오류가 있습니다.
이것은 내 요구 사항입니다
public JsonResult SetGridProperties(Response<T> res)
{
res.ShowFilterRow = (!res.ShowFilterRow);
return Json(true, JsonRequestBehavior.AllowGet);
}
내 응답 클래스는 다음과 같습니다.
public class Response<T>
{
public bool Status { get; set; }
public string Message { get; set; }
public T Data { get; set; }
public List<T> DataList { get; set; }
public MessageTypes MessageType { get; set; }
public bool ShowFilterRow { get; set; }
public bool AllowGroup { get; set; }
}
이 Response 클래스를 동적 엔터티 개체가 'T'인 매개 변수로 사용하는 방법을 알려주십시오.
메서드 정의에 T를 지정해야합니다.
public JsonResult SetGridProperties<T>(Response<T> res)
{
res.ShowFilterRow = (!res.ShowFilterRow);
return Json(true, JsonRequestBehavior.AllowGet);
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다