Example #1
0
 public void Remove(ResearStatus item)
 {
     if (item != null)
     {
         control.Remove(item);
         control.SaveChanges();
     }
     else
     {
         throw new Exception("This item not found in DataBase");
     }
 }
Example #2
0
        public ResearStatus Get(int id)
        {
            ResearStatus temp = control.GetAll().FirstOrDefault(x => x.Id == id);

            if (temp != null)
            {
                return(temp);
            }
            else
            {
                throw new Exception("Not Found Gender in DataBase");
            }
        }
Example #3
0
        public ResearStatus Add(ResearStatus item)
        {
            ResearStatus temp = control.GetAll().FirstOrDefault(x => x.Researches == item.Researches);

            if (temp == null)
            {
                temp = control.Add(item);
                control.SaveChanges();
                return(temp);
            }
            else
            {
                throw new Exception("This Gender alredy in base");
            }
        }
Example #4
0
 public void Remove(ResearStatus item)
 {
     context.ResearStatus.Remove(item);
 }
Example #5
0
 public ResearStatus Add(ResearStatus item)
 {
     return(context.ResearStatus.Add(item));
 }