This commit is contained in:
@@ -3,17 +3,25 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
|
||||
|
||||
|
||||
public class ApiOkResponse
|
||||
//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 object Data { get; }
|
||||
public bool ReadOnly {get;}
|
||||
|
||||
public ApiOkResponse(object result, bool isReadOnly)
|
||||
public static object Response(object result, bool isReadOnly)
|
||||
{
|
||||
Data = result;
|
||||
ReadOnly=isReadOnly;
|
||||
if (isReadOnly)
|
||||
{
|
||||
return new
|
||||
{
|
||||
Data = result,
|
||||
ReadOnly = true
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new { Data = result };
|
||||
}
|
||||
|
||||
}
|
||||
}//eoc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user