예제 #1
0
 public Observe Add(Observe observe)
 {
     if (context.Observed.Where(x => x.UserId == observe.UserId && x.UserObserverdId == observe.UserObserverdId).FirstOrDefault() == null)
     {
         context.Observed.Add(observe);
         context.SaveChanges();
     }
     return(observe);
 }
예제 #2
0
        public Observe Remove(string observeUserId)
        {
            Observe observe = context.Observed.Find(observeUserId);

            if (observe != null)
            {
                context.Observed.Remove(observe);
                context.SaveChanges();
            }
            return(observe);
        }