/// <summary> /// Deletes the entity given its unique ID. /// </summary> /// /// <param name="userContext"> /// User context. /// </param> /// /// <param name="id"> /// Unique ID. /// </param> /// /// <returns> /// The number of affected rows. /// </returns> public int Delete(IUserContext userContext, long id) { using (var et = new ExecutionTracerService()) using (var db = new RoleCrud(userContext)) { return(db.Delete(id)); } }
/// <summary> /// Deletes the entity from the database. /// </summary> /// /// <param name="userContext"> /// User context. /// </param> /// /// <param name="entity"> /// Entity to delete. /// </param> /// /// <returns> /// The number of affected rows. /// </returns> public int Delete(IUserContext userContext, VahapYigit.Test.Models.Role entity) { using (var et = new ExecutionTracerService()) using (var db = new RoleCrud(userContext)) { return(db.Delete(entity)); } }
public void Delete(Role role) { try { CrudFactory.Delete(role); } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }