Пример #1
0
        public static int Delete(object dataToDelete, IDataAccessAdapter dataAccessAdapter)
        {
            var listItemType = ListBindingHelper.GetListItemType(dataToDelete);

            if (typeof(IEntity2).IsAssignableFrom(listItemType))
            {
                var enumerable = dataToDelete as IEnumerable;
                return(enumerable == null?Convert.ToInt32(dataAccessAdapter.DeleteEntity((IEntity2)dataToDelete)) : DeleteEntities(enumerable, dataAccessAdapter));
            }
            return(0);
        }
Пример #2
0
        public bool Delete(PinChangelog pinChangelog)
        {
            var PinChangelogEntity = Mapper.Map <PinChangelog, PinChangelogEntity>(pinChangelog);

            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                if (!myAdapter.DeleteEntity(PinChangelogEntity))
                {
                    throw new PersistenceFailureException();
                }
                return(true);
            }
        }
Пример #3
0
 protected void ExpectDeleteEntity(bool wasDeletionSuccessful)
 {
     Expect.Call(_dataAccessAdapter.DeleteEntity(null)).IgnoreArguments().Return(wasDeletionSuccessful);
 }