示例#1
0
        public async Task <bool> insertLoginInfo(LoginInfo loginInfo)
        {
            try
            {
                await _context.AddAsync(loginInfo);

                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#2
0
        public async Task <Account> CreateFromUserAsync(Dtos.User user)
        {
            var entity = new Account()
            {
                UserId          = user.Id,
                MonthlySalary   = user.MonthlySalary,
                MonthlyExpenses = user.MonthlyExpenses,
                UserEmail       = user.Email,
                UserName        = user.Name,
                DateCreated     = DateTime.Now
            };

            await _accountContext.AddAsync(entity);

            await _accountContext.SaveChangesAsync();

            return(entity);
        }
示例#3
0
        public async Task <Acc> CreateAsync(Acc account)
        {
            await _accountContext.AddAsync(account);

            return(account);
        }
示例#4
0
 public async Task CreateItem(Account account)
 {
     await _context.AddAsync(account);
 }
        public async Task AddSistema(Sistema sistema)
        {
            await _accountContext.AddAsync(sistema);

            await _accountContext.SaveChangesAsync();
        }
示例#6
0
        /// <summary>
        /// Generic Add() method to add new data into the database
        /// </summary>
        /// <param name="entity">Object entity using the generic Add()</param>
        /// <returns>Returns the object entity added to the database</returns>
        public async virtual Task <T> Add(T entity)
        {
            await _context.AddAsync(entity).ConfigureAwait(true);

            return(entity);
        }