Exemplo n.º 1
0
        public async Task <DbStatus> Delete(Event entity)
        {
            Event existingEvent = await GetByPrimaryKey(entity);

            if (existingEvent == null)
            {
                return(DbStatus.NOT_FOUND);
            }

            DbCommand <Event> deleteCommand     = new CompletelyDeleteCommand <Event>();
            DbStatus          statusOfExecution = await ServiceHelper <Event> .ExecuteCRUDCommand(deleteCommand, entity);

            return(statusOfExecution);
        }
        public async Task <DbStatus> Delete(Account entity)
        {
            // Account with specified id doesn't exists
            Account existingAccount = await GetByPrimaryKey(entity);

            if (existingAccount == null)
            {
                return(DbStatus.NOT_FOUND);
            }

            DbCommand <Account> deleteCommand     = new CompletelyDeleteCommand <Account>();
            DbStatus            statusOfExecution = await ServiceHelper <Account> .ExecuteCRUDCommand(deleteCommand, entity);

            return(statusOfExecution);
        }
        public async Task <DbStatus> Delete(Category entity)
        {
            // Category with specified id doesn't exists
            Category existingCategory = await GetByPrimaryKey(entity);

            if (existingCategory == null)
            {
                return(DbStatus.NOT_FOUND);
            }

            DbCommand <Category> deleteCommand     = new CompletelyDeleteCommand <Category>();
            DbStatus             statusOfExecution = await ServiceHelper <Category> .ExecuteCRUDCommand(deleteCommand, entity);

            return(statusOfExecution);
        }
Exemplo n.º 4
0
        public async Task <DbStatus> Delete(City entity)
        {
            // Check if exists
            City city = await GetByPrimaryKey(entity);

            if (city == null)
            {
                return(DbStatus.NOT_FOUND);
            }

            // Delete entity with command
            DbCommand <City> deleteCommand = new CompletelyDeleteCommand <City>();
            DbStatus         deleteStatus  = await ServiceHelper <City> .ExecuteCRUDCommand(deleteCommand, entity);

            return(deleteStatus);
        }