コード例 #1
0
        public override async Task OnActivateAsync()
        {
            _userGrainId = UserGrainId.FromString(this.GetPrimaryKeyString());
            _dbContext   = await _interpreter.Interpret(_dbContextPort, Unit.Default);

            _dbContext.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;

            await GetData();
        }
コード例 #2
0
        public override async Task OnActivateAsync()
        {
            _dbContext = await _interpreter.Interpret(_dbContextPort, Unit.Default);

            _userGrainId = UserGrainId.FromString(this.GetPrimaryKeyString());

            await _dbContext.User.Where(u => u.UserId == _userGrainId.UserId)
            .Include(u => u.TenantUser).ThenInclude(tu => tu.Vote)
            .Include(u => u.TenantUser).ThenInclude(tu => tu.PostTenantUser)
            .LoadAsync();

            _ctx = new UserWriteContext(
                new EFList <User>(_dbContext.User)
                );
        }