Bzs.Server.ServerService.AccountServerService.GetAccountId C# (CSharp) Метод

GetAccountId() публичный Метод

Returns the account identifier.
public GetAccountId ( string account ) : System.Guid
account string The account.
Результат System.Guid
        public Guid GetAccountId(string account)
        {
            using (BzsEntityContainer ctx = this.CreateContainer())
            {
                AccountEntity entity = ctx.AccountSet.FirstOrDefault(f => f.Account == account);
                if (entity != null)
                {
                    return entity.Id;
                }
            }

            return Guid.Empty;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Deletes a subject.
        /// </summary>
        /// <param name="idToDelete">The identifier.</param>
        /// <returns>The result.</returns>
        public ResultDto DeleteSubject(IdDto idToDelete)
        {
            this.SetResponseHeaderCacheExpiration();

            AccountPassword credentials = this.GetCredentialsFromRequest();
            AccountServerService accountService = new AccountServerService();
            Guid accountId = accountService.GetAccountId(credentials.Account);

            SubjectServerService service = new SubjectServerService();
            return service.DeleteSubject(idToDelete.Id, accountId);
        }
All Usage Examples Of Bzs.Server.ServerService.AccountServerService::GetAccountId