예제 #1
0
        public async Task LoadDefaultEntities(EntityIdSet idSet)
        {
            SalaryIncome = await LoadEntity <IncomeType>(idSet.SalaryIncomeId);

            GiftsIncome = await LoadEntity <IncomeType>(idSet.GiftsIncomeId);

            FoodCategory = await LoadEntity <Category>(idSet.FoodCategoryId);

            TechCategory = await LoadEntity <Category>(idSet.TechCategoryId);

            Bread = await LoadEntity <Product>(idSet.BreadId);

            Meat = await LoadEntity <Product>(idSet.MeatId);

            Tv = await LoadEntity <Product>(idSet.TvId);

            FoodExpenseFlow = await LoadEntity <ExpenseFlow>(idSet.FoodExpenseFlowId);

            TechExpenseFlow = await LoadEntity <ExpenseFlow>(idSet.TechExpenseFlowId);

            DebitCardAccount = await LoadEntity <Account>(idSet.DebitCardAccountId);

            CashAccount = await LoadEntity <Account>(idSet.CashAccountId);

            CreditCardAccount = await LoadEntity <Account>(idSet.CreditCardAccountId);

            Incomes = (await LoadEntities <IncomeItem>()).OrderBy(x => x.DateTime).ToList();
        }
예제 #2
0
        protected async Task <UserQuerySession> CreateSession(User user, EntityIdSet idSet = null)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            var session = new UserQuerySession(_databaseName, user);

            if (idSet == null)
            {
                return(session);
            }
            await session.LoadDefaultEntities(idSet);

            return(session);
        }
예제 #3
0
 protected async Task <UserQuerySession> CreateDefaultSession(EntityIdSet idSet = null)
 {
     return(await CreateSession(DefaultUser, idSet));
 }