Last active
February 7, 2024 04:50
-
-
Save gistlyn/8c1dd406e83e4949734922cda60853e0 to your computer and use it in GitHub Desktop.
AutoGen AutoQuery Services for Existing DBs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet add package ServiceStack.Server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ServiceStack; | |
[assembly: HostingStartup(typeof(MyApp.ConfigureAutoQuery))] | |
namespace MyApp; | |
public class ConfigureAutoQuery : IHostingStartup | |
{ | |
public void Configure(IWebHostBuilder builder) => builder | |
.ConfigureServices(services => { | |
services.AddPlugin(new AutoQueryFeature { | |
MaxLimit = 1000, | |
IncludeTotal = true, | |
GenerateCrudServices = new GenerateCrudServices { | |
AutoRegister = true, | |
//AddDataContractAttributes = false, | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment