public bool ValidateFirebaseSetting(FirebaseSettingDto dto) { try { new ExamService(dto.ProjectId, dto.JsonCredentials); return(true); } catch (System.Exception) { return(false); } }
public async Task <FirebaseSettingDto> CreateOrFirebaseSetting(FirebaseSettingDto dto) { var container = _cosmosClient.GetContainer(DatabaseId, ContainerId); var entity = dto.To <FirebaseSetting>(); if (string.IsNullOrEmpty(dto.Id)) { entity.Id = Guid.NewGuid().ToString(); var response = await container.CreateItemAsync <FirebaseSetting>(entity, new PartitionKey(dto.UserId)); entity = response.Resource; } else { var response = await container.ReplaceItemAsync <FirebaseSetting>(entity, entity.Id, new PartitionKey(entity.UserId)); entity = response.Resource; } return(entity.To <FirebaseSettingDto>()); }
public async Task <FirebaseSettingDto> CreateOrFirebaseSetting(FirebaseSettingDto dto) { return(await _service.CreateOrFirebaseSetting(dto)); }