Assuming that I have application .NET Core 2.1 Web API + Angular 7
Why should I always returns ActionResult?
Is there any difference between this:
public ActionResult<MyDTO> GetData(){
return new MyDTO();
}
and that:
public MyDTO GetData(){
return new MyDTO();
}
In both cases I'll receive object on UI, and both returns code 200. So is just good practice to using ActionResult, or what?