예제 #1
0
        public async Task <OperationResult <community> > GetByNameAsync(string name)
        {
            community community = await communityRepo.GetByNameAsync(name);

            if (community != null)
            {
                community.comment = community.comment.OrderByDescending(item => item.initialDate).ToList();
                return(new OperationResult <community>()
                {
                    Success = true, Message = Messages.COMMUNITY_SUCCESS, Result = community
                });
            }
            return(new OperationResult <community>()
            {
                Success = false, Message = Messages.COMMUNITY_NOT_EXIST_NAME
            });
        }