PhotoEntity.Controllers.Manager.RemoveData C# (CSharp) Method

RemoveData() public method

public RemoveData ( ) : bool
return bool
        public bool RemoveData()
        {
            try
            {
                foreach (var e in ds.RoleClaims)
                {
                    ds.Entry(e).State = System.Data.Entity.EntityState.Deleted;
                }
                ds.SaveChanges();

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }

Usage Example

コード例 #1
0
 public ActionResult Remove()
 {
     if (m.RemoveData())
     {
         return(Content("data has been removed"));
     }
     else
     {
         return(Content("could not remove data"));
     }
 }