public void Delete(User item) { using (var dbContext = new AccountDbContext()) { dbContext.Delete <User>(item); } }
public void Logout(Guid token) { using (var dbContext = new AccountDbContext()) { var loginInfo = dbContext.FindAll <LoginInfo>(l => l.LoginToken == token).FirstOrDefault(); if (loginInfo != null) { dbContext.Delete <LoginInfo>(loginInfo); } } CacheHelper.Remove(string.Format(_LoginInfoKeyFormat, token)); }
public Result <TEntity> Delete(int id) { dbContext.Delete <TEntity>(t => t.Id.Equals(id)); return(Result <TEntity> .Success()); }
public Result <TEntity> Delete(TEntity entity) { dbContext.Delete <TEntity>(entity); return(Result <TEntity> .Success()); }