ReviewR.Web.Api.IterationsController.Get C# (CSharp) Method

Get() public method

public Get ( int id ) : HttpResponseMessage
id int
return System.Net.Http.HttpResponseMessage
        public HttpResponseMessage Get(int id)
        {
            Requires.InRange(id >= 0, "id");

            Iteration iter = Iterations.GetIteration(id);
            if (iter == null)
            {
                return NotFound();
            }
            else if (iter.Review.UserId != User.Identity.UserId && !iter.Published)
            {
                return Forbidden();
            }
            return Ok(iter.Files.GroupBy(GetDirectoryName).Select(g => new FolderModel
            {
                Name = g.Key ?? "/",
                Files = g.Select(f => new FileModel
                {
                    Id = f.Id,
                    FileName = g.Key == null ? f.DisplayFileName : f.DisplayFileName.Substring(g.Key.Length + 1),
                    FullPath = f.DisplayFileName,
                    ChangeType = f.ChangeType,
                    HasComments = f.Comments.Any()
                }).ToArray()
            }).ToArray());
        }