DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
WebApplicationBuilder.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
WebAppCore/Builder/WebApplicationBuilder.h
"
3
#include "
WebAppCore/Builder/WebApplication.h
"
4
#include "
Extensions/DependencyInjection/ServiceProvider.h
"
5
6
namespace
DotNetDupe
{
7
namespace
WebAppCore
{
8
namespace
Builder
{
9
11
WebApplicationBuilder::WebApplicationBuilder
() =
default
;
12
14
WebApplicationBuilder::WebApplicationBuilder
(
WebApplicationBuilder
&& other) noexcept
15
: m_services(std::move(other.m_services)),
16
m_controllerRegistrars(std::move(other.m_controllerRegistrars)) {}
17
19
WebApplicationBuilder
&
WebApplicationBuilder::operator=
(
WebApplicationBuilder
&& other)
noexcept
{
21
if
(
this
!= &other) {
23
m_services = std::move(other.m_services);
24
m_controllerRegistrars = std::move(other.m_controllerRegistrars);
25
}
27
return
*
this
;
28
}
29
31
System::SmartPointer<WebApplication>
WebApplicationBuilder::Build
() {
33
auto
spProvider = m_services.BuildServiceProvider();
34
36
auto
spApp =
System::SmartPointer<WebApplication>::NewShared
(spProvider);
37
39
spApp->SetSelfPointer(spApp);
40
spApp->SetControllerRegistrars(std::move(m_controllerRegistrars));
41
43
return
spApp;
44
}
45
46
}
47
}
48
}
ServiceProvider.h
WebApplication.h
Represents the web application used to configure the HTTP pipeline and routes mirroring ASP....
WebApplicationBuilder.h
Builder pattern orchestrator for configuring services, controllers, and constructing WebApplication i...
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::SmartPointer::NewShared
static SmartPointer< T > NewShared()
Creates a Shared SmartPointer, default constructing T.
Definition
SmartPointer.h:277
DotNetDupe::WebAppCore::Builder::WebApplicationBuilder::operator=
WebApplicationBuilder & operator=(const WebApplicationBuilder &)=delete
DotNetDupe::WebAppCore::Builder::WebApplicationBuilder::Build
DotNetDupe::System::SmartPointer< WebApplication > Build()
Builds the dependency injection service provider and constructs the configured WebApplication host.
Definition
WebApplicationBuilder.cpp:31
DotNetDupe::WebAppCore::Builder::WebApplicationBuilder::WebApplicationBuilder
WebApplicationBuilder()
Initializes a new instance of the WebApplicationBuilder class.
DotNetDupe::WebAppCore::Builder
Definition
WebApplication.h:21
DotNetDupe::WebAppCore
Definition
WebApplication.h:20
DotNetDupe
Definition
IServiceCollection.h:7
pch.h
DotNetDupe
WebApplicationBuilder.cpp
Generated by
1.18.0