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

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

public Update ( Community community ) : Community
community Blog.Common.Contracts.Community
Результат Blog.Common.Contracts.Community
        public Community Update(Community community)
        {
            try
            {
                var checkCommunity = IsCommunityNameInUse(community.Name, community.Id);
                if (checkCommunity)
                {
                    return new Community().GenerateError<Community>((int)Constants.Error.ValidationError,
                        string.Format("Community name {0} is already in use.", community.Name));
                }

                return CommunityMapper.ToDto(_communityRepository.Edit(CommunityMapper.ToEntity(community)));
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }