示例#1
0
        /// <summary>
        /// The actual Work to be done.
        /// </summary>
        protected override void Execute()
        {
            List <RepositoryModel> newlist = new List <RepositoryModel>();

            RepositoryModel repositoryModel = new RepositoryModel();

            if (this.Request.RepositoryId > 0)
            {
                repositoryModel = Util.ConvertToRepositoryModel(RepositoryRepository.FirstOrDefault(c => c.Id == this.Request.RepositoryId));
            }
            else
            {
                foreach (repository item in RepositoryRepository.GetRepositoriess())
                {
                    newlist.Add(Util.ConvertToRepositoryModel(item));
                }
            }

            Response = new ResponseModel()
            {
                Repository         = repositoryModel,
                Repositories       = newlist,
                IsOperationSuccess = true
            };
        }