public void ContainsDBKeyFeature() { var keyFeat = CreateNew(); using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); kfDAO = new DbKeyFeatureDAO(db); kfDAO.Add(keyFeat); Assert.IsTrue(kfDAO.ContainsDB(keyFeat)); } }
public bool Save(KeyFeature entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } CheckArgument(entity); int id; if (!keyFeatureDAO.ContainsDB(entity)) { id = keyFeatureDAO.Add(entity); } else { return(false); } return(id > 0); }