Esempio n. 1
0
        public async Task <Guid?> CreateAsync(CreateLocalizationProject project)
        {
            var projectId = await _localizationProjectRepository.AddAsync(project);

            await _userActionRepository.AddCreateProjectActionAsync((Guid)ur.GetID(User.Identity.Name), User.Identity.Name, (Guid)projectId, (Guid)project.ID_Source_Locale);

            var userId      = (Guid)ur.GetID(User.Identity.Name);
            var roleIdOwner = (Guid)_roleRepository.GetRoleId("owner");

            var participant = new Participant
            {
                ID_Localization_Project = projectId,
                ID_User = userId,
                ID_Role = roleIdOwner,
                Active  = true
            };

            await _participantsRepository.AddAsync(participant);

            return(projectId);
        }