ShopPlatform.Web 1.0.0.0
농산물, 소프트웨어 라이선스와 개발 용역을 직접 판매하는 CodeMaru 직영 쇼핑몰입니다.
로딩중...
검색중...
일치하는것 없음
ShopPlatform.Services.ShopCustomerLoginSync 클래스 참조sealed

더 자세히 ...

ShopPlatform.Services.ShopCustomerLoginSync에 대한 협력 다이어그램:

Public 멤버 함수

 ShopCustomerLoginSync (ShopUserContext userContext, ShopCustomerProfileStore profiles, ShopCustomerSession session)
async Task< bool > SyncAsync (string slug)
async Task SaveProfileAsync (string slug, string name, string phone, string address, string email)

Private 속성

readonly ShopUserContext _userContext
readonly ShopCustomerProfileStore _profiles
readonly ShopCustomerSession _session

상세한 설명

Shop Customer Login Sync 기능과 관련 상태를 캡슐화합니다.

ShopCustomerLoginSync.cs 파일의 13 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ ShopCustomerLoginSync()

ShopPlatform.Services.ShopCustomerLoginSync.ShopCustomerLoginSync ( ShopUserContext userContext,
ShopCustomerProfileStore profiles,
ShopCustomerSession session )
inline

지정한 설정으로 ShopCustomerLoginSync 클래스의 새 인스턴스를 초기화합니다.

매개변수
userContextuser Context에 사용할 ShopUserContext 값입니다.
profilesprofiles에 사용할 ShopCustomerProfileStore 값입니다.
sessionsession에 사용할 ShopCustomerSession 값입니다.

ShopCustomerLoginSync.cs 파일의 75 번째 라인에서 정의되었습니다.

79 {
80 _userContext = userContext;
81 _profiles = profiles;
82 _session = session;
83 }

다음을 참조함 : _profiles, _session, _userContext.

멤버 함수 문서화

◆ SaveProfileAsync()

async Task ShopPlatform.Services.ShopCustomerLoginSync.SaveProfileAsync ( string slug,
string name,
string phone,
string address,
string email )
inline

Profile Async 데이터를 저장합니다.

매개변수
slugslug에 사용할 string 값입니다.
namename에 사용할 string 값입니다.
phonephone에 사용할 string 값입니다.
addressaddress에 사용할 string 값입니다.
emailemail에 사용할 string 값입니다.
반환값
Save Profile Async 작업에서 생성한 Task 결과입니다.

ShopCustomerLoginSync.cs 파일의 183 번째 라인에서 정의되었습니다.

184 {
185 var user = await _userContext.GetCurrentAsync().ConfigureAwait(false);
186 if (!user.IsAuthenticated)
187 {
188 return;
189 }
190
191 var profile = new ShopCustomerProfile
192 {
193 UserId = user.Id,
194 Provider = user.Provider,
195 Email = string.IsNullOrWhiteSpace(email) ? user.Email : email.Trim(),
196 DisplayName = user.DisplayName,
197 Name = string.IsNullOrWhiteSpace(name) ? user.DisplayName : name.Trim(),
198 Phone = phone.Trim(),
199 Address = address.Trim()
200 };
201
202 await _profiles.SaveAsync(slug, profile).ConfigureAwait(false);
203 _session.LoginFromCommonUser(user, profile);
204 }

다음을 참조함 : _profiles, _session, _userContext.

◆ SyncAsync()

async Task< bool > ShopPlatform.Services.ShopCustomerLoginSync.SyncAsync ( string slug)
inline

Sync Async 작업을 수행합니다.

매개변수
slugslug에 사용할 string 값입니다.
반환값
Sync Async 작업에서 생성한 Task<bool> 결과입니다.

ShopCustomerLoginSync.cs 파일의 109 번째 라인에서 정의되었습니다.

110 {
111 if (_session.IsLoggedIn)
112 {
113 return true;
114 }
115
116 var user = await _userContext.GetCurrentAsync().ConfigureAwait(false);
117 if (!user.IsAuthenticated)
118 {
119 return false;
120 }
121
122 var profile = await _profiles.GetAsync(slug, user.Id).ConfigureAwait(false);
123 _session.LoginFromCommonUser(user, profile);
124 return true;
125 }

다음을 참조함 : _profiles, _session, _userContext.

멤버 데이터 문서화

◆ _profiles

readonly ShopCustomerProfileStore ShopPlatform.Services.ShopCustomerLoginSync._profiles
private

profiles 값을 보관합니다.

ShopCustomerLoginSync.cs 파일의 32 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : SaveProfileAsync(), ShopCustomerLoginSync(), SyncAsync().

◆ _session

readonly ShopCustomerSession ShopPlatform.Services.ShopCustomerLoginSync._session
private

session 값을 보관합니다.

ShopCustomerLoginSync.cs 파일의 41 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : SaveProfileAsync(), ShopCustomerLoginSync(), SyncAsync().

◆ _userContext

readonly ShopUserContext ShopPlatform.Services.ShopCustomerLoginSync._userContext
private

user Context 값을 보관합니다.

ShopCustomerLoginSync.cs 파일의 23 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : SaveProfileAsync(), ShopCustomerLoginSync(), SyncAsync().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: