Esempio n. 1
0
        internal static async Task <AspNetRoleGroupRole> InsertRoleGroupRoles(AspNetRoleGroupRole model)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    var roleGroup = db.AspNetRoleGroupRoles.Add(model);
                    int x         = await Task.Run(() => db.SaveChangesAsync());

                    return(roleGroup);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        public async Task <RoleGroupRolesModel> CreateRoleGroupRoles(RoleGroupRolesModel model)
        {
            try
            {
                foreach (RoleModel r in model.roles)
                {
                    AspNetRoleGroupRole data = new AspNetRoleGroupRole();
                    data.RoleGroupId = model.roleGroup.id;
                    data.RoleId      = r.id;
                    AspNetRoleGroupRole res = await Task.Run(() => ManageRole.InsertRoleGroupRoles(data));
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }