Generic Code
Generic Code
/// <summary>
/// The GetWrapper
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="val">The val<see cref="bool"/></param>
/// <returns>The <see cref="ResponseWrapper{T}"/></returns>
private static ResponseWrapper<T> GetWrapper<T>(bool val) where T : class
{
var responseWrapper = new ResponseWrapper<T>();
responseWrapper.Code = val ? (int)Constants.StatusCode.Ok :
(int)Constants.StatusCode.InternalServerError;
responseWrapper.Status = val ? Constants.MessageStatus.Success :
Constants.MessageStatus.Error;
responseWrapper.Message = val ? Constants.SuccessMessage :
Constants.SqlNotSaved;
return responseWrapper;
}