コード例 #1
0
        //public async Task<IEnumerable<ApplicationUser>> Get(Dictionary<string, dynamic> obj)
        //{
        //    var result = await _adapter.ExecuteQuery<ApplicationUser>(obj, "usp_User_Read");
        //    return result;
        //}

        public async Task <IdentityResult> CreateAsync(ApplicationUser user)
        {
            user.LockoutEndDateUtc = DateTime.Now;
            int result = await _adapter.ExecuteSingle(user, "usp_User_Create");

            if (result > 0)
            {
                return(IdentityResult.Success);
            }

            return(IdentityResult.Failed(new IdentityError {
                Description = $"Không thể thêm {user.Email}."
            }));
        }
コード例 #2
0
        public async Task <DataService <int> > CreateAsync <T>(T obj)
        {
            var type = typeof(T);

            try
            {
                var ret = await _adapter.ExecuteSingle(obj, DataHelper.StoreProcedure(type, DataHelper.ApiCRUD.Create), "", DataHelper.GetInstance(type));

                return(ret.FlushData());
            }
            catch (Exception ex)
            {
                return(ex.FatalException <int>());
            }
        }
コード例 #3
0
 public async Task <bool> CreateAsync(Permission per)
 {
     return(await _adapter.ExecuteSingle(per, "usp_Permission_Create") > 0);
 }
コード例 #4
0
        public async Task <int> CreateOrUpdateRAsync(ApplicationRole model)
        {
            var result = await _adapter.ExecuteSingle <ApplicationRole, int>(model, "usp_Role_CreateOrUpdate");

            return(result);
        }
コード例 #5
0
        /// <summary>
        /// Create
        /// </summary>
        /// <param name="obj">Module Object</param>
        /// <returns></returns>
        public async Task <bool> CreateAsync(Module obj)
        {
            var result = await _adapter.ExecuteSingle(obj, "usp_Module_Create");

            return(result > 0);
        }