コード例 #1
0
        public ProfileDto?AddNewProfile(IAccountModel accountModel)
        {
            if (string.IsNullOrEmpty(accountModel.ProfileId))
            {
                return(null);
            }
            var profile = _profilesService.Create(accountModel.ToNewProfileEntity());

            return(profile?.ToProfileDto());
        }
コード例 #2
0
        public ProfileDto?UpdateProfile(IAccountModel accountModel)
        {
            if (
                string.IsNullOrEmpty(accountModel.ProfileId) ||
                string.IsNullOrEmpty(accountModel.Id)
                )
            {
                return(null);
            }

            var updated = _profilesService.UpdatePassively(accountModel.ToNewProfileEntity());

            if (updated != null || !string.IsNullOrEmpty(updated?.Id))
            {
                return(updated.ToProfileDto());
            }
            return(null);
        }