protected void AddErrorResponse(ErrorCode errorCode) { if (errorCode == ErrorCode.ERROR_RECORD_NOT_FOUND) { Response.StatusCode = System.Net.HttpStatusCode.NoContent.GetValue <int>(); } else { Response.StatusCode = System.Net.HttpStatusCode.Conflict.GetValue <int>(); } Response.Error.Add(new ResponseError() { Code = errorCode, Description = errorCode.GetAttributeDescription() }); }