Skip to content

how can i use auto api start with [BasicAspNetCoreApplication] template? #274

Open
@HuiJiOnGit

Description

@HuiJiOnGit

I'm using the [BasicAspNetCoreApplication] template to get started, but I want to use it in conjunction with [Auto Api] in this template,

I added the following code, but it doesn't seem to take effect

AppModule

public override void ConfigureServices(ServiceConfigurationContext context)
{
     Configure<AbpAspNetCoreMvcOptions>(options =>
     {
          options.ConventionalControllers.Create(typeof(AppModule).Assembly);
     });
}

and i add a TestAppService in root path

public class TestAppService : ApplicationService
{
    [HttpGet]
    public int Get()
    {
        return 0;
    }

    [HttpPost]
    public int Post()
    {
        return 0;
    }

    [HttpPut]
    public int Put()
    {
        return 0;
    }

    [HttpDelete]
    public int Delete()
    {
        return 0;
    }
}

Here are my dependence, what else do I need to do?

  <ItemGroup>
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
    <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="7.2.2" />
    <PackageReference Include="Volo.Abp.Autofac" Version="7.2.2" />
  </ItemGroup>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions