SELECT COUNT ( * ) FROM `User_Master` AS `u` INNER JOIN `AspNetUsers` AS `a` ON `u` . `Email` = `a` . `Email` WHERE ( ( `u` . `ParentId` = ? ) AND ( `u` . `RoleStr` = ? ) ) AND ( `a` . `IsActive` OR NOT ( `a` . `IsDeleted` ) ) 