예제 #1
0
        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));
            }
        }
예제 #2
0
        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);
        }