Blog.Logic.Core.CommunityLogic.Delete C# (CSharp) Метод

Delete() публичный Метод

public Delete ( int communityId ) : bool
communityId int
Результат bool
        public bool Delete(int communityId)
        {
            try
            {
                var db = _communityRepository.Find(a => a.Id == communityId, false).FirstOrDefault();
                if (db == null) return false;

                db.IsDeleted = true;
                db.Members.Clear();
                db.Members.Add(db.Leader);

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