Beispiel #1
0
        public IActionResult GetEntryPoint()
        {
            var model = new EntryPointModel
            {
                Version = GetType().Assembly.GetName().Version?.ToString() ?? ""
            };

            return(Ok(model.AsResource()));
        }
        public IActionResult GetEntryPoint()
        {
            // The root resource containing URLs defining entry points
            // used to initiate communication with the API.
            var rootEntryPoint = new EntryPointModel
            {
                Version = GetType().Assembly.GetName().Version.ToString()
            }.AsResource();

            // Child entry resources can be used to better organize
            // and group API specific set of Urls:
            rootEntryPoint.EmbedResource(new ManagementEntryPoint().AsResource(), "management");
            rootEntryPoint.EmbedResource(new DataEntryPoint().AsResource(), "data");

            return(Ok(rootEntryPoint));
        }