public FileDTO GetFile(int id)
        {
            GetFileByIdResponse result = _dataService.GetFileById(new GetFileByIdRequest {FileId = id});
            var returnVal = new FileDTO();

            if (result.Success)
            {
                returnVal.Id = result.File.Id;
                returnVal.Name = result.File.Name;
                returnVal.Description = result.File.Description;
                returnVal.Data = result.File.Data;
                returnVal.LastModified = result.File.LastModified;
                returnVal.Snippet_Id = result.File.Snippet_Id;
            }
            return returnVal;
        }
        public int CreateNewFile(FileDTO file)
        {
            Guard.ArgNotNull(file, "file");
            var result = new CreateFileResponse();
            int newFileId = -1;
            try
            {
                result = _dataService.CreateFile(new CreateFileRequest
                                                     {
                                                         Name = file.Name,
                                                         Description = file.Description,
                                                         Data = file.Data,
                                                         LastModified = file.LastModified,
                                                         SnippetId = file.Snippet_Id
                                                     });
            }
            catch (Exception ex)
            {
                Logger.LogError("Error creating new file", ex);
            }

            return result.FileId;
        }
        public IEnumerable<FileDTO> GetFiles(int userId, Guid userGuid, int snippetId)
        {
            GetFilesByUserIdResponse result =
                _dataService.GetFilesByUserId(new GetFilesByUserIdRequest
                                                  {UserId = userId, UserGuid = userGuid, SnippetId = snippetId});
            IList<FileDTO> returnValue = new List<FileDTO>();
            if (result.Success)
            {
                foreach (FileDTO file in result.Files)
                {
                    var temp = new FileDTO
                                   {
                                       Id = file.Id,
                                       Name = file.Name,
                                       Description = file.Description,
                                       Data = file.Data,
                                       Snippet_Id = file.Snippet_Id,
                                       LastModified = file.LastModified
                                   };
                    returnValue.Add(temp);
                }
            }

            return returnValue;
        }
        public GetFileByIdResponse GetFileById(GetFileByIdRequest request)
        {
            var response = new GetFileByIdResponse();

            try
            {
                Guard.ArgNotNull(request, "request");

                File results = _unitOfWork.FileRepository.GetById(request.FileId);
                Guard.ArgNotNull(results, "results");

                var returnDTO = new FileDTO
                                    {
                                        Id = results.Id,
                                        Name = results.Name,
                                        Description = results.Description,
                                        Data = results.Data,
                                        LastModified = results.LastModified,
                                        Snippet_Id = results.Snippet_Id
                                    };
                response.Success = true;
                response.File = returnDTO;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.FailureInformation = ex.Message;
                Logger.LogError("GetFileById Method Failed", ex);
            }

            return response;
        }