public Update ( |
||
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);
}
}