Beispiel #1
0
 public IActionResult Post([FromBody] UserDefinedGroup userDefinedGroup)
 {
     using (var scope = new TransactionScope())
     {
         _Repo.Insert(userDefinedGroup);
         scope.Complete();
         return(CreatedAtAction(nameof(Get), new { id = userDefinedGroup.Id }, userDefinedGroup));
     }
 }
Beispiel #2
0
 public IActionResult Put([FromBody] UserDefinedGroup userDefinedGroup)
 {
     if (userDefinedGroup != null)
     {
         using (var scope = new TransactionScope())
         {
             _Repo.Update(userDefinedGroup);
             scope.Complete();
             return(new OkResult());
         }
     }
     return(new NoContentResult());
 }
Beispiel #3
0
 public void Insert(UserDefinedGroup item)
 {
     dBContext.UserDefinedGroups.Add(item);
     Save();
 }
Beispiel #4
0
 public void Remove(UserDefinedGroup item)
 {
     dBContext.UserDefinedGroups.Remove(item);
     Save();
 }
Beispiel #5
0
 public void Update(UserDefinedGroup item)
 {
     dBContext.Entry(item).State = EntityState.Modified;
     Save();
 }