public IHttpActionResult GetAttributes() { CodebookResponse _responseEnvelope = new CodebookResponse(Request.Properties["requestId"].ToString(), true); String apiUser = RequestContext.Principal.Identity.Name; AutomationManager.AttributeObjectToAttributeApiObject(AutomationManager.attributes); AttributesManager = new AttributesManager(AutomationManager.IAttributeRepository.Object); var result = new AttributesController(AttributesManager, this.Request, this.RequestContext).GetAttributes() as OkNegotiatedContentResult<CodebookResponse>; return Ok(result.Content); }
public IHttpActionResult GetAttributes() { MonitorEvent evt = new MonitorEvent("OfferService"); int status = 1; CodebookResponse _responseEnvelope = new CodebookResponse(Request.Properties["requestId"].ToString(), true); String apiUser = RequestContext.Principal.Identity.Name; OperationName = operationName.GetAttributes.ToString(); //Get the attributes and put them into the response envelope try { _responseEnvelope.Data = AttributesManager.GetPublishedAttributes(Request, apiUser); } catch (Exception e) { //Edit for R184 _responseEnvelope.Data.Errors.Add(new ErrorObject(ErrorKey.ERR_INTERNAL_FATAL)); //R185 Modification //_responseEnvelope.Data.Errors.Add(new ErrorObject(ErrorKey.ERR_INTERNAL_FATAL)); LoggerFactory.GetLogger().InfoJson(new Methods().Exception_ToLogObject(_responseEnvelope.Meta.Id, apiUser, OperationType, OperationName, e)); status = 0; } finally { if (_responseEnvelope.Data.Errors.Count > 0) { if (_responseEnvelope.Data.Errors.Exists(i => i.Id == ErrorKey.ERR_INTERNAL_FATAL)) status = 0; _responseEnvelope.Status = false; } else _responseEnvelope.Data.Errors = null; evt.Log(_responseEnvelope.Meta.Id, "GetAttributeList", status); } return Ok(_responseEnvelope); }