public async Task <IActionResult> CreateApiResourceAsync(PropertyValue[] properties)
        {
            var metadata = await GetCoreMetaDataAsync();

            if (!metadata.SupportsCreate)
            {
                return(MethodNotAllowed());
            }
            if (properties == null)
            {
                ModelState.AddModelError("", Messages.ApiResourceDataRequired);
            }

            var errors = ValidateCreateProperties(metadata, properties);

            foreach (var error in errors)
            {
                ModelState.AddModelError("", error);
            }

            if (ModelState.IsValid)
            {
                var result = await _service.CreateAsync(properties);

                if (result.IsSuccess)
                {
                    var url      = Url.RelativeLink(Constants.RouteNames.GetApiResource, new { subject = result.Result.Subject });
                    var resource = new
                    {
                        Data  = new { subject = result.Result.Subject },
                        Links = new { detail = url }
                    };
                    return(Created(url, resource));
                }

                ModelState.AddErrors(result);
            }
            return(BadRequest(""));
        }