public void CreateRestriction(string requestor, string restrictee, bool strict, bool makeReverse) { MatchRestriction restrict = new MatchRestriction() { RequestorName = requestor, RestrictedName = restrictee, StrictRestriction = strict }; _context.MatchRestrictions.Add(restrict); if (makeReverse) { MatchRestriction restrictReverse = new MatchRestriction() { RequestorName = restrictee, RestrictedName = requestor, StrictRestriction = strict }; _context.MatchRestrictions.Add(restrictReverse); } }
public void CreateRestriction(string requestor, string restrictee, bool strict, bool makeReverse) { MatchRestriction restrict = new MatchRestriction() { Id = _restrictions?.LastOrDefault()?.Id + 1 ?? 1, RequestorName = requestor, RestrictedName = restrictee, StrictRestriction = strict }; _restrictions.Add(restrict); if (makeReverse) { MatchRestriction restrictReverse = new MatchRestriction() { Id = _restrictions?.LastOrDefault()?.Id + 1 ?? 1, RequestorName = restrictee, RestrictedName = requestor, StrictRestriction = strict }; _restrictions.Add(restrictReverse); } }