public BaseResponse RemoveClient(RemoveClientRequest request) { return(ServiceProcessor.ProcessRequest(request, //inbound.do validate or do something here () => { }, req => { var response = new BaseResponse(); using (var repo = new NhRepository <Client>()) { foreach (var id in req.Ids) { var entity = repo.GetById(id); if (entity != null) { repo.Delete(entity); } } } return response; } )); }
public void DeleteTest() { using (var session = SessionManager.GetConnection()) { using (var repo = new NhRepository <Court>()) { var entity = repo.GetById(3); if (entity != null) { repo.Delete(entity); } } } }