Skip to content

Commit 0b6fe35

Browse files
authored
Merge pull request #42 from sandeepsnairms/main
Adding Cosmos DB NoSQL Sample
2 parents 1d33067 + 02569ec commit 0b6fe35

21 files changed

+1143
-50
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ hs_err_pid*
5858
/target/
5959

6060
*.iml
61+
/C#/CosmosDB-NoSQL_CognitiveSearch/appsettings.Development.json
62+
/C#/CosmosDB-NoSQL/appsettings.Development.json

C#/CosmosDB-MongoDBvCore/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"AllowedHosts": "*",
1010

11-
"RecipeLocalFolder": "..\\..\\DataSet\\Recipe",
11+
"RecipeLocalFolder": "..\\..\\..\\..\\..\\DataSet\\Recipe",
1212

1313
"OpenAIEndpoint": "https://{Account Name}.openai.azure.com/",
1414
"OpenAIKey": "",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<Content Include="appsettings.*.json">
12+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
13+
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
</Content>
16+
<None Remove="appsettings - Copy.json" />
17+
<None Remove="appsettings.Development.json" />
18+
<Content Include="appsettings.json">
19+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20+
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
21+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
22+
</Content>
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.17" />
27+
<PackageReference Include="Microsoft.Azure.Cosmos" Version="4.0.1" />
28+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
29+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
30+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
31+
<PackageReference Include="Spectre.Console" Version="0.47.0" />
32+
</ItemGroup>
33+
34+
35+
36+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.6.33801.468
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CosmosRecipeGuide", "CosmosRecipeGuide.csproj", "{536B20AF-59DD-41E6-B026-04604B027E16}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{536B20AF-59DD-41E6-B026-04604B027E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{536B20AF-59DD-41E6-B026-04604B027E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{536B20AF-59DD-41E6-B026-04604B027E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{536B20AF-59DD-41E6-B026-04604B027E16}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {D3F3F260-C622-4969-A2BD-23C2D4C1371B}
24+
EndGlobalSection
25+
EndGlobal

C#/CosmosDB-NoSQL/Model/Recipe.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace CosmosRecipeGuide
8+
{
9+
10+
public class Recipe
11+
{
12+
13+
public string id { get; set; }
14+
public string name { get; set; }
15+
public string description { get; set; }
16+
public List<float> vectors { get; set; }
17+
public string cuisine { get; set; }
18+
public string difficulty { get; set; }
19+
public string prepTime { get; set; }
20+
public string cookTime { get; set; }
21+
public string totalTime { get; set; }
22+
public int servings { get; set; }
23+
public List<string> ingredients { get; set; }
24+
public List<string> instructions { get; set; }
25+
}
26+
27+
28+
}

0 commit comments

Comments
 (0)