コード例 #1
0
        public static void edit(uint id, Users changes)
        {
            var orig = get(id);

            using (var dbContext = new WashingtonRedskinsContext())
            {
                dbContext.Entry(orig).CurrentValues.SetValues(changes);
                dbContext.Entry(orig).State = EntityState.Modified;
                dbContext.SaveChanges();
            }
        }
コード例 #2
0
ファイル: Registrations.cs プロジェクト: arhidia/WRS
        public static void edit(Registrations newRegistration, uint origId)
        {
            var orig = get(origId);

            using (var dbContext = new WashingtonRedskinsContext())
            {
                dbContext.Entry(orig).CurrentValues.SetValues(newRegistration);
                dbContext.Entry(orig).State = EntityState.Modified;
                dbContext.SaveChanges();
            }
            var earliestTime = newRegistration.Time < orig.Time ? newRegistration.Time : orig.Time;

            RegistrationsEdits.set(earliestTime);
        }
コード例 #3
0
        public static void delete(uint id)
        {
            var orig = get(id);

            using (var dbContext = new WashingtonRedskinsContext())
            {
                orig.DeletedAt = DateTime.Now;
                dbContext.Entry(orig).State = EntityState.Modified;
                dbContext.SaveChanges();
            }
        }