Exemplo n.º 1
0
        public async Task <ActionResult> Upload([FromForm] Plugin plugin, ApiVersion version)
        {
            try
            {
                var uploadedPlugin = await _pluginService.Add(plugin, plugin.File);

                return(CreatedAtAction("GetById",
                                       "Plugin",
                                       new { id = uploadedPlugin.Id, version = version.ToString() },
                                       uploadedPlugin));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }