Blog.Logic.Core.HobbyLogic.Delete C# (CSharp) Method

Delete() public method

public Delete ( int hobbyId ) : bool
hobbyId int
return bool
        public bool Delete(int hobbyId)
        {
            try
            {
                var db = _hobbyRepository.Find(a => a.HobbyId == hobbyId, false).FirstOrDefault();
                if (db == null) return false;

                _hobbyRepository.Delete(db);
                return true;
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }
    }