Files
raven/server/AyaNova/ControllerHelpers/ApiOkResponse.cs
2019-04-30 19:41:00 +00:00

29 lines
673 B
C#

namespace AyaNova.Api.ControllerHelpers
{
//return the response with optional readonly flag
//this exists basically for consistency and to reduce the bandwidth if not readonly which is most common
public static class ApiOkResponse
{
public static object Response(object result, bool isReadOnly)
{
if (isReadOnly)
{
return new
{
Data = result,
ReadOnly = true
};
}
else
{
return new { Data = result };
}
}
}//eoc
}//eons