コード例 #1
0
        public NFLModel Delete(int id)
        {
            NFLModel nfl = NFLList.Find(nfl1 => nfl1.Id == id);

            if (nfl == null)
            {
                return(null);
            }

            NFLList.Remove(nfl);
            return(nfl);
        }
コード例 #2
0
        public NFLModel Update(int id, NFLModel update)
        {
            NFLModel Nfl = NFLList.Find(nfl1 => nfl1.Id == id);

            if (Nfl == null)
            {
                return(null);
            }

            Nfl.Id       = update.Id;
            Nfl.Initials = update.Initials;
            Nfl.Name     = update.Name;
            return(Nfl);
        }
コード例 #3
0
 public NFLModel Put(int id, [FromBody] NFLModel value)
 {
     return(NFLManager.Update(id, value));
 }
コード例 #4
0
 public NFLModel Add(NFLModel NewNFLTeam)
 {
     NewNFLTeam.Id = nextId++;
     NFLList.Add(NewNFLTeam);
     return(NewNFLTeam);
 }
コード例 #5
0
 public NFLModel Post([FromBody] NFLModel value)
 {
     return(NFLManager.Add(value));
 }