예제 #1
0
        /// <summary>
        /// This function deletes the dataobject after finding it into the database
        /// </summary>
        /// <param name="dataObject"></param>
        /// <returns></returns>
        public CustomResponse Delete(T dataObject)
        {
            T existing = dbSet.Find(dataObject);

            dbSet.Remove(existing);
            return(new CustomResponse()
            {
                Status = 200,
                Data = _context.SaveChanges(),
                Result = "Data deleted successfully"
            });
        }
예제 #2
0
 public void Save()
 {
     _context.SaveChanges();
 }