/// <summary> /// Deletes the material entity passed from the database /// </summary> /// <param name="material">The material to be deleted</param> /// <returns>Number of rows that have changed</returns> public int Delete(Material material) { _context.Remove(material); return(_context.SaveChanges()); }
/// <summary> /// Deletes an address entity from the context and removes it from the database as well. /// WARNING: Calling this method WILL save any other changes made to the same context /// passed to the controller!!! /// </summary> /// <param name="address">The address entity to be deleted</param> /// <returns>The number of changed rows</returns> /// <remarks>Not tested</remarks> public int Delete(Address address) { _db.Remove(address); return(_db.SaveChanges()); }
/// <summary> /// Deletes a volume entry from the database /// </summary> /// <param name="volume"></param> /// <returns>The number of rows changed</returns> public int Delete(Volume volume) { _context.Remove(volume); return(_context.SaveChanges()); }
public int Delete(Member t) { //doesn't work due a lack of Cascading deletes. db.Remove(t); return(db.SaveChanges()); }
/// <summary> /// Deletes an author entity from the context and applies the removal to the database. /// </summary> /// <param name="author">The author to be removed</param> /// <returns>The number of rows affected on the database</returns> /// <remarks>NOT TESTED</remarks> public int Delete(Author author) { _db.Remove(author); return(_db.SaveChanges()); }