Beispiel #1
0
        public IHttpActionResult UpdateClub(Club club)
        {
            PenOCDataContext db = new PenOCDataContext();

            lutClub clubRecord = db.lutClubs.Single(c => c.idClub == club.id);

            clubRecord.strFullName = club.fullName;
            clubRecord.strShortName = club.shortName;

            db.SubmitChanges();

            return Ok(club);
        }
Beispiel #2
0
        public IHttpActionResult InsertClub(Club club)
        {
            PenOCDataContext db = new PenOCDataContext();

            lutClub clubRecord = new lutClub
            {
                strFullName = club.fullName,
                strShortName = club.shortName

            };

            db.lutClubs.InsertOnSubmit(clubRecord);
            db.SubmitChanges();

            club.id = clubRecord.idClub;

            return Ok(club);
        }