Пример #1
0
        public async Task <ActionResult <Conclusions> > Conclusions(long?id)
        {
            Conclusions con = await db.Conclusions.FirstOrDefaultAsync(x => x.Id == id);

            if (con == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(con));
        }
Пример #2
0
        /// <summary>
        /// Initializes an instance with the specified information.
        /// </summary>
        /// <param name="conclusions">All conclusions.</param>
        /// <param name="views">All views.</param>
        /// <param name="exocet">The exocet.</param>
        /// <param name="digits">All digits.</param>
        /// <param name="techniqueCode">The technique code.</param>
        /// <param name="lockedMemberQ">The locked member Q.</param>
        /// <param name="lockedMemberR">The locked member R.</param>
        /// <param name="targetEliminations">The target eliminations.</param>
        /// <param name="mirrorEliminations">The mirror eliminations.</param>
        /// <param name="bibiEliminations">
        /// The Bi-bi pattern eliminations (only used for junior exocets).
        /// </param>
        /// <param name="targetPairEliminations">
        /// The target pair eliminations (only used for junior exocets).
        /// </param>
        /// <param name="swordfishEliminations">
        /// The swordfish pattern eliminations (only used for junior exocets).
        /// </param>
        /// <param name="trueBaseEliminations">
        /// The true base eliminations (only used for senior exocets).
        /// </param>
        /// <param name="compatibilityEliminations">
        /// The compatibility test eliminations (only used for senior exocets).
        /// </param>
        public ExocetTechniqueInfo(
            IReadOnlyList <Conclusion> conclusions, IReadOnlyList <View> views,
            Exocet exocet, IEnumerable <int> digits, TechniqueCode techniqueCode,
            IEnumerable <int>?lockedMemberQ, IEnumerable <int>?lockedMemberR,
            TargetEliminations targetEliminations, MirrorEliminations mirrorEliminations,
            BibiPatternEliminations bibiEliminations, TargetPairEliminations targetPairEliminations,
            SwordfishEliminations swordfishEliminations, TrueBaseEliminations trueBaseEliminations,
            CompatibilityTestEliminations compatibilityEliminations)
            : base(conclusions, views)
        {
            (Exocet, Digits, TechniqueCode, LockedMemberQ, LockedMemberR) = (exocet, digits, techniqueCode, lockedMemberQ, lockedMemberR);

            var list = (List <Conclusion>)Conclusions;

            if (!((TargetEliminations = targetEliminations).Conclusions is null))
            {
                list.AddRange(TargetEliminations);
            }
            if (!((MirrorEliminations = mirrorEliminations).Conclusions is null))
            {
                list.AddRange(MirrorEliminations);
            }
            if (!((BibiEliminations = bibiEliminations).Conclusions is null))
            {
                list.AddRange(BibiEliminations);
            }
            if (!((TargetPairEliminations = targetPairEliminations).Conclusions is null))
            {
                list.AddRange(TargetPairEliminations);
            }
            if (!((SwordfishEliminations = swordfishEliminations).Conclusions is null))
            {
                list.AddRange(SwordfishEliminations);
            }
            if (!((TrueBaseEliminations = trueBaseEliminations).Conclusions is null))
            {
                list.AddRange(TrueBaseEliminations);
            }
            if (!((CompatibilityTestEliminations = compatibilityEliminations).Conclusions is null))
            {
                list.AddRange(CompatibilityTestEliminations);
            }

            var temp = Conclusions.Distinct().ToList();             // Call 'ToList' to execute the query forcedly.

            list.Clear();
            list.AddRange(temp);
        }
Пример #3
0
 /// <summary>
 /// Добавление заключений в таблицу заключений
 /// </summary>
 /// <param name="conclusions">Список заключений, которые надо добавить</param>
 /// <param name="ruleID">Номер правила, которому принадлежат эти заключения</param>
 private void AddConclusions(IEnumerable <AddChangeRule.Fact> conclusions, int ruleID)
 {
     foreach (AddChangeRule.Fact vic in conclusions)
     {
         var varID = _esCopy.Variables.Single(x => x.Name == vic.VarName);
         var valID = _esCopy.Values.Single(x => x.Name == vic.ValName && x.Domains == varID.Domains);
         var conc  = new Conclusions
         {
             VariableID = varID.Id,
             ValueID    = valID.Id,
             RuleID     = ruleID,
             Number     = vic.Num
         };
         _esCopy.Conclusions.InsertOnSubmit(conc);
         _esCopy.SubmitChanges();
     }
 }