public IActionResult GetEntities([FromQuery] string entityType = "")
        {
            try
            {
                var stopwatch = StopwatchLogger.Start(_log);
                _log.Info("Called MetadataController GetEntities");

                var result = _iMetadataManager.GetEntities(false).OrderBy(t => t.Name);

                if (entityType.ToLower() == "primaryentity")
                {
                    result = result.Where(a => a.Type.ToLower() == "primaryentity" || a.Type.ToLower() == "detailentity" || a.Type.ToLower() == "intersectentity").OrderBy(t => t.Name);
                }

                stopwatch.StopAndLog("GetEntities of MetadataController");
                return(_iJsonMessage.IgnoreNullableObject(result));
            }
            catch (Exception ex)
            {
                //_log.Error("Error calling MetadataController.GetEntities method.");
                //throw new Exception(ex.Message);
                _log.Error(ExceptionFormatter.SerializeToString(ex));
                return(StatusCode((int)HttpStatusCode.InternalServerError, ApiConstant.CustomErrorMessage));
            }
        }
Example #2
0
        public IActionResult GetLayoutsDetailsById(Guid id)
        {
            try {
                var stopwatch = StopwatchLogger.Start(_log);
                _log.Info("Called PicklistController GetLayoutsDetailsById");

                if (id == Guid.Empty)
                {
                    return(BadRequest("Picklist id required !"));
                }

                var layout = _iLayoutManager.GetPicklistLayoutDetailsById(TenantCode, id);

                stopwatch.StopAndLog("GetLayoutsDetailsById of PicklistController");
                if (layout != null)
                {
                    return(_iJsonMessage.IgnoreNullableObject(layout));
                }

                return(NotFound("No default layout found."));
            } catch (Exception ex) {
                _log.Error(ExceptionFormatter.SerializeToString(ex));
                return(StatusCode((int)HttpStatusCode.InternalServerError, ApiConstant.CustomErrorMessage));
            }
        }