Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] TypeP typeP)
        {
            if (id != typeP.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(typeP);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TypePExists(typeP.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeP));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Name")] TypeP typeP)
        {
            if (ModelState.IsValid)
            {
                _context.Add(typeP);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeP));
        }
Beispiel #3
0
        public virtual int CompareTo(Expr other)
        {
            var pCmp = TypeP.CompareTo(other.TypeP);

            if (pCmp == 0)
            {
                pCmp = TypeS.CompareTo(other.TypeS);
                if (pCmp == 0)
                {
                    pCmp = TypeT.CompareTo(other.TypeT);
                }
            }

            return(pCmp);
        }
Beispiel #4
0
 public override int GetHashCode() => TypeP.GetHashCode() ^ TypeS.GetHashCode() ^ TypeS.GetHashCode();