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

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

public Get ( int communityId ) : Community
communityId int
Результат Blog.Common.Contracts.Community
        public Community Get(int communityId)
        {
            try
            {
                
                var db = _communityRepository.Get(communityId);
                if (db == null)
                {
                    return new Community().GenerateError<Community>((int)Constants.Error.RecordNotFound,
                        string.Format("Cannot find community with Id {0}", communityId));
                }

                var result = CommunityMapper.ToDto(db);
                result.MemberCount = GetCommunityMemberCount(result.Id);

                return result;
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }