예제 #1
0
        public SetRecord CreateOrUpdateSetRecord(SetRecord setRecord)
        {
            using (var db = new WorkoutDb())
            {
                if (db.SetRecords.Any(x => x.SetRecordId == setRecord.SetRecordId))
                {
                    db.Update(setRecord);
                }
                else
                {
                    db.Add(setRecord);
                }

                db.SaveChanges();

                return(setRecord);
            }
        }