コード例 #1
0
        public Account AuthorizedAccount(long accountId)
        {
            Account account = null;

            Repository.Entities.Account entityAccount = accountRepository.Get(accountId);

            if (entityAccount != null)
            {
                account = new Account(entityAccount.id, entityAccount.username, entityAccount.firstname, entityAccount.lastname);
            }

            return(account);
        }
コード例 #2
0
ファイル: AccountDb.cs プロジェクト: feijie999/Vertex
        public async Task EventHandle(CreateEvent evt, EventMeta eventBase)
        {
            using (var db = this.ServiceProvider.GetService <TransferDbContext>())
            {
                try
                {
                    var entity = new Repository.Entities.Account()
                    {
                        Id = this.ActorId
                    };

                    this.accountSnapshotHandler.EntityHandle(entity, evt);
                    db.Accounts.Add(entity);
                    await db.SaveChangesAsync();
                }
                catch (System.Exception e)
                {
                    e.PGExceptionHandler <AccountDb>();
                }
            }
        }