public ProjectMetadataResultContract GetProjectMetadata(long projectId, GetProjectMetadataParameter parameters)
        {
            var work           = new GetLatestProjectMetadataWork(m_metadataRepository, projectId, parameters);
            var result         = work.Execute();
            var resultContract = result != null
                ? Mapper.Map <ProjectMetadataResultContract>(result)
                : new ProjectMetadataResultContract
            {
                Publisher = new PublisherContract()
            };

            if (result != null && parameters.IsAnyAdditionalParameter())
            {
                var project = result.Resource.Project;

                if (parameters.IncludeAuthor)
                {
                    resultContract.AuthorList = Mapper.Map <List <OriginalAuthorContract> >(project.Authors);
                }
                if (parameters.IncludeResponsiblePerson)
                {
                    resultContract.ResponsiblePersonList = Mapper.Map <List <ResponsiblePersonContract> >(project.ResponsiblePersons);
                }
                if (parameters.IncludeKind)
                {
                    resultContract.LiteraryKindList = Mapper.Map <List <LiteraryKindContract> >(project.LiteraryKinds);
                }
                if (parameters.IncludeGenre)
                {
                    resultContract.LiteraryGenreList = Mapper.Map <List <LiteraryGenreContract> >(project.LiteraryGenres);
                }
            }

            return(resultContract);
        }
        public ProjectMetadataResultContract GetProjectMetadata(long projectId, GetProjectMetadataParameter parameters)
        {
            var work           = new GetLatestProjectMetadataWork(m_metadataRepository, projectId, parameters);
            var result         = work.Execute();
            var resultContract = result != null
                ? m_mapper.Map <ProjectMetadataResultContract>(result)
                : new ProjectMetadataResultContract();

            if (parameters.IsAnyAdditionalParameter())
            {
                var project = work.GetProjectWithAdditionalData();

                if (parameters.IncludeAuthor)
                {
                    resultContract.AuthorList = m_mapper.Map <List <OriginalAuthorContract> >(project.Authors);
                }
                if (parameters.IncludeResponsiblePerson)
                {
                    resultContract.ResponsiblePersonList = m_mapper.Map <List <ProjectResponsiblePersonContract> >(project.ResponsiblePersons);
                }
                if (parameters.IncludeKind)
                {
                    resultContract.LiteraryKindList = m_mapper.Map <List <LiteraryKindContract> >(project.LiteraryKinds);
                }
                if (parameters.IncludeGenre)
                {
                    resultContract.LiteraryGenreList = m_mapper.Map <List <LiteraryGenreContract> >(project.LiteraryGenres);
                }
                if (parameters.IncludeOriginal)
                {
                    resultContract.LiteraryOriginalList = m_mapper.Map <List <LiteraryOriginalContract> >(project.LiteraryOriginals);
                }
                if (parameters.IncludeKeyword)
                {
                    resultContract.KeywordList = m_mapper.Map <List <KeywordContract> >(project.Keywords);
                }
                if (parameters.IncludeCategory)
                {
                    resultContract.CategoryList = m_mapper.Map <List <CategoryContract> >(project.Categories);
                }
            }

            return(resultContract);
        }