private static bool Validate(ResourceClientInfo rc, GenericResult result) { if (rc == null) { result.Success = false; AppendMessage(result, "Could not find a ResourceClient with the given ResourceID and ClientID."); return(false); } return(true); }
private static void DeleteToolEngineer(ISession session, IResource res, Client c, GenericResult result) { if (Validate(res, c, result)) { ResourceClientInfo rci = session.Query <ResourceClientInfo>().FirstOrDefault(x => x.ClientID == c.ClientID && x.ResourceID == res.ResourceID); if (Validate(rci, result)) { ResourceClient rc = session.Single <ResourceClient>(rci.ResourceClientID); session.Delete(rc); } } }