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; } }
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; } }