public async Task SetMaturityModel(Guid maturityModelId, int value)
        {
            var maturityDefined = MaturityModels.Value.FirstOrDefault(m => m.MaturityModelId == maturityModelId);

            var maturityRepo = UtilDomain.GetService <IMaturityModelRepository>();
            var maturity     = await maturityRepo.GetAsync(maturityModelId);

            if (maturity == null)
            {
                throw new DefineMaturityModelNotFoundException(maturityModelId, this);
            }

            if (!maturity.Options.Exists(o => o.Value == value))
            {
                throw new DefineOptionMaturityModelNotFoundException(this, maturity, value);
            }

            if (maturityDefined == null)
            {
                maturityDefined = await MaturityModelDefined.CreateAsync(this, maturity, value);

                MaturityModels.Value.Add(maturityDefined);
            }
            else
            {
                await maturityDefined.UpdateAsync(value);
            }
        }
        public static async Task <MaturityModelDefined> CreateAsync(ProjectDomain project, MaturityModelDomain maturity, int value)
        {
            var mm = new MaturityModelDefined {
                MaturityModelId = maturity.MaturityModelId,
                ProjectId       = project.ProjectId,
                Value           = value
            };

            var projectRepo = UtilDomain.GetService <IProjectRepository>();
            await projectRepo.AddMaturityModel(mm);

            return(mm);
        }