SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var baseAddRules = await _repo.GetBaseAddRules();
  2.  
  3.             var addRulesNested = objectTypes
  4.                 .Join(
  5.                 baseAddRules,
  6.                 obj => obj.BaseTypeId,
  7.                 rule => rule.ObjectId,
  8.                 (obj, rule) =>
  9.                 {
  10.                     var possibleForObj = objectTypes.Where(x => x.BaseTypeId == rule.PossibleParentId).ToList();
  11.                     var newRule = possibleForObj.Select(s => new AddRules
  12.                     {
  13.                         Object = obj,
  14.                         PossibleParent = objectTypes.Where(x => x.BaseTypeId == rule.PossibleParentId).FirstOrDefault(),
  15.                     });
  16.                     return newRule;
  17.                 });
  18.  
  19.             var addRules = addRulesNested.SelectMany(s => s.Select(x => x))
  20.                                          .ToList();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top