Beispiel #1
0
        // Register the coach
        public async Task <string> RegisterCoachAsync(CoachRegisterModel coachRegisterModel)
        {
            if (!UserExist(coachRegisterModel.UserId))
            {
                throw new Exception("The user doesn't existe");
            }
            if (CoachExist(coachRegisterModel.UserId))
            {
                throw new Exception("The coach already exists");
            }

            string coachId = await RegisterToDatabase(coachRegisterModel);

            await _formsService.RegisterFormToDatabseAsync(coachRegisterModel.UserId, coachRegisterModel.FormQAs);

            return(coachId);
        }
Beispiel #2
0
        // Register the builder
        public async Task <string> RegisterBuilderAsync(BuilderRegisterModel builderRegisterModel)
        {
            if (!UserExist(builderRegisterModel.UserId))
            {
                throw new Exception("The user doesn't existe");
            }
            if (BuilderExist(builderRegisterModel.UserId))
            {
                throw new Exception("The builder already exists");
            }

            string builderId = await RegisterToDatabase(builderRegisterModel);

            await _formsService.RegisterFormToDatabseAsync(builderRegisterModel.UserId, builderRegisterModel.FormQAs);

            return(builderId);
        }