Beispiel #1
0
        public async Task <Member> Get()
        {
            ProviderManager = new ProviderManager(Request, this.User);
            var user = await ProviderManager.Get();

            if (user == null)
            {
                return(null);
            }

            User foundUser = await UserManager.FindByEmailAsync(user.Email);

            if (foundUser != null)
            {
                if (!AgilifyContext.Members.Select(m => m.Id).Contains(foundUser.Id))
                {
                    return(await DomainManager.InsertAsync(foundUser));
                }
                else
                {
                    return(AgilifyContext.Members.Find(foundUser.Id));
                }
            }
            else
            {
                return(await Create(user));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 创建实例
        /// </summary>
        /// <returns>实现了接口T的对象</returns>
        /// <remarks>2013-6-26 杨浩 创建</remarks>
        public static T Create()
        {
            if (_daoInstance != null)
            {
                return(_daoInstance);
            }

            _daoInstance = ProviderManager.Get <IDataProvider>().Create <T>();

            return(_daoInstance);
        }
Beispiel #3
0
        public virtual IDbTransaction BeginTransaction(IsolationLevel isolationLevel)
        {
            IDbTransaction transaction = Transaction;

            if (transaction == null)
            {
                transaction = ProviderManager.Get <IDataProvider>().BeginTransaction(isolationLevel);

                m_Transaction = transaction;
            }

            m_TransactionOpened = true;

            return(transaction);
        }
 public async Task <IActionResult> GetList(int skip, int limit, [FromQuery] string languageCode = null, [FromQuery] string q = null)
 {
     return(Ok(await _providerManager.Get(skip, limit, languageCode, q)));
 }