Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

RestAPI return fields under sppecific condition

$
0
0

I have a class which I return as per request

public class OutputModel
    {

        public string Id { get; set; }
        public int Status{ get; set; }
        public int Error{ get; set; }
       
    }

I want to return the Error property only in specific cases, else the user will get only the Id and Status.

is this possible?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>