Skip to content

Commit e815579

Browse files
committed
first commit
0 parents  commit e815579

File tree

194 files changed

+5800
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+5800
-0
lines changed

CRUD_Firebase/Program.cs

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
using FireSharp.Config;
2+
using FireSharp.Interfaces;
3+
using FireSharp.Response;
4+
using FireSharp;
5+
6+
namespace Firebase{
7+
public class Commands{
8+
private static IFirebaseConfig config = new FirebaseConfig(){
9+
AuthSecret="zXLrjwMjz6ZthqcM9fwFkyR77oDLuw5nO5WKaQr3",
10+
BasePath="https://hackathonete-default-rtdb.firebaseio.com/"
11+
};
12+
private static IFirebaseClient client = new FirebaseClient(config);
13+
public static void Create(int targetId,string Nome,string Email){
14+
Usuario novoUsuario = new Usuario{//Create de object
15+
Id=targetId,
16+
Nome=Nome,
17+
Email=Email
18+
};
19+
client.Set($"Users/{targetId}", novoUsuario);//Create the User/{targetId} path and add the newUser object in this path
20+
}
21+
22+
public static void Delete(int targetId){
23+
client.Delete($"Users/{targetId}");//Delete the path targetId
24+
}
25+
26+
public static List<Usuario> Read(string Nome){
27+
FirebaseResponse userData;
28+
List<Usuario> finalList=new List<Usuario>();
29+
List<Usuario> listUserObject=new List<Usuario>();
30+
userData=client.Get("Users/");
31+
listUserObject=userData.ResultAs<List<Usuario>>();
32+
if(Nome==""){
33+
return listUserObject;
34+
}else{
35+
foreach(Usuario user in listUserObject){
36+
if((user.Nome).IndexOf(Nome)!=-1){
37+
finalList.Add(user);
38+
}
39+
}
40+
}
41+
return finalList;
42+
}
43+
44+
public static void Update(int targetId,string Nome,string Email){
45+
Usuario novoUsuario = new Usuario{//Create de object
46+
Id=targetId,
47+
Nome=Nome,
48+
Email=Email
49+
};
50+
client.Update($"Users/{targetId}", novoUsuario);//Update the User/{targetId} path with the updatedUser data
51+
}
52+
53+
public static void Main(){
54+
Create(1,"Kauã","emaildoKaua@kaua.com");
55+
Create(2,"Jão","emaildojao@jao.com");
56+
List<Usuario> resultadoPesquisa;
57+
resultadoPesquisa=Read("J");
58+
foreach(Usuario user in resultadoPesquisa){
59+
Console.WriteLine(user.Nome);
60+
}
61+
Update(2,"Pedro","emaildoPedro@Pedro.com");
62+
resultadoPesquisa=Read("P");
63+
foreach(Usuario user in resultadoPesquisa){
64+
Console.WriteLine(user.Nome);
65+
}
66+
Delete(2);
67+
}
68+
}
69+
public class Usuario{//It creates the object that will be sended to DB
70+
public int Id;
71+
public string Nome;
72+
public string Email;
73+
}
74+
}
40 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v6.0",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v6.0": {
9+
"teste/1.0.0": {
10+
"dependencies": {
11+
"FireSharp": "2.0.4",
12+
"System.Security.Permissions": "7.0.0"
13+
},
14+
"runtime": {
15+
"teste.dll": {}
16+
}
17+
},
18+
"FireSharp/2.0.4": {
19+
"dependencies": {
20+
"Microsoft.Bcl.Async": "1.0.168",
21+
"Microsoft.Net.Http": "2.2.28",
22+
"Newtonsoft.Json": "6.0.4"
23+
},
24+
"runtime": {
25+
"lib/portable-net45+sl5+wp8+win8/FireSharp.dll": {
26+
"assemblyVersion": "2.0.3.0",
27+
"fileVersion": "2.0.3.0"
28+
}
29+
}
30+
},
31+
"Microsoft.Bcl/1.1.9": {
32+
"dependencies": {
33+
"Microsoft.Bcl.Build": "1.0.14"
34+
}
35+
},
36+
"Microsoft.Bcl.Async/1.0.168": {
37+
"dependencies": {
38+
"Microsoft.Bcl": "1.1.9"
39+
},
40+
"runtime": {
41+
"lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {
42+
"assemblyVersion": "1.0.168.0",
43+
"fileVersion": "1.0.168.0"
44+
},
45+
"lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {
46+
"assemblyVersion": "1.0.12.0",
47+
"fileVersion": "1.0.168.0"
48+
},
49+
"lib/net40/Microsoft.Threading.Tasks.dll": {
50+
"assemblyVersion": "1.0.12.0",
51+
"fileVersion": "1.0.168.0"
52+
}
53+
}
54+
},
55+
"Microsoft.Bcl.Build/1.0.14": {},
56+
"Microsoft.Net.Http/2.2.28": {
57+
"dependencies": {
58+
"Microsoft.Bcl": "1.1.9",
59+
"Microsoft.Bcl.Build": "1.0.14"
60+
},
61+
"runtime": {
62+
"lib/net45/System.Net.Http.Extensions.dll": {
63+
"assemblyVersion": "2.2.28.0",
64+
"fileVersion": "2.2.28.0"
65+
},
66+
"lib/net45/System.Net.Http.Primitives.dll": {
67+
"assemblyVersion": "4.2.28.0",
68+
"fileVersion": "4.2.28.0"
69+
}
70+
}
71+
},
72+
"Microsoft.Win32.SystemEvents/7.0.0": {
73+
"runtime": {
74+
"lib/net6.0/Microsoft.Win32.SystemEvents.dll": {
75+
"assemblyVersion": "7.0.0.0",
76+
"fileVersion": "7.0.22.51805"
77+
}
78+
},
79+
"runtimeTargets": {
80+
"runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll": {
81+
"rid": "win",
82+
"assetType": "runtime",
83+
"assemblyVersion": "7.0.0.0",
84+
"fileVersion": "7.0.22.51805"
85+
}
86+
}
87+
},
88+
"Newtonsoft.Json/6.0.4": {
89+
"runtime": {
90+
"lib/net45/Newtonsoft.Json.dll": {
91+
"assemblyVersion": "6.0.0.0",
92+
"fileVersion": "6.0.4.17603"
93+
}
94+
}
95+
},
96+
"System.Drawing.Common/7.0.0": {
97+
"dependencies": {
98+
"Microsoft.Win32.SystemEvents": "7.0.0"
99+
},
100+
"runtime": {
101+
"lib/net6.0/System.Drawing.Common.dll": {
102+
"assemblyVersion": "7.0.0.0",
103+
"fileVersion": "7.0.22.51805"
104+
}
105+
},
106+
"runtimeTargets": {
107+
"runtimes/win/lib/net6.0/System.Drawing.Common.dll": {
108+
"rid": "win",
109+
"assetType": "runtime",
110+
"assemblyVersion": "7.0.0.0",
111+
"fileVersion": "7.0.22.51805"
112+
}
113+
}
114+
},
115+
"System.Security.Permissions/7.0.0": {
116+
"dependencies": {
117+
"System.Windows.Extensions": "7.0.0"
118+
},
119+
"runtime": {
120+
"lib/net6.0/System.Security.Permissions.dll": {
121+
"assemblyVersion": "7.0.0.0",
122+
"fileVersion": "7.0.22.51805"
123+
}
124+
}
125+
},
126+
"System.Windows.Extensions/7.0.0": {
127+
"dependencies": {
128+
"System.Drawing.Common": "7.0.0"
129+
},
130+
"runtime": {
131+
"lib/net6.0/System.Windows.Extensions.dll": {
132+
"assemblyVersion": "7.0.0.0",
133+
"fileVersion": "7.0.22.51805"
134+
}
135+
},
136+
"runtimeTargets": {
137+
"runtimes/win/lib/net6.0/System.Windows.Extensions.dll": {
138+
"rid": "win",
139+
"assetType": "runtime",
140+
"assemblyVersion": "7.0.0.0",
141+
"fileVersion": "7.0.22.51805"
142+
}
143+
}
144+
}
145+
}
146+
},
147+
"libraries": {
148+
"teste/1.0.0": {
149+
"type": "project",
150+
"serviceable": false,
151+
"sha512": ""
152+
},
153+
"FireSharp/2.0.4": {
154+
"type": "package",
155+
"serviceable": true,
156+
"sha512": "sha512-laSHpVUBG6iCTUixmpeUmYxie2zbziOBM+LU0v2A0ETE9dUyBA+8aY63xql/o8LXj+kFybBLYUKBUrLCZWaq+A==",
157+
"path": "firesharp/2.0.4",
158+
"hashPath": "firesharp.2.0.4.nupkg.sha512"
159+
},
160+
"Microsoft.Bcl/1.1.9": {
161+
"type": "package",
162+
"serviceable": true,
163+
"sha512": "sha512-USQ55innJy8K+tAXvVa1O8dUTp2s7pmJ5cJj6Tl02HtGc2xBDj0P2QH5620HbGXIWKWYhydoeQF8Rm/JRDBGhw==",
164+
"path": "microsoft.bcl/1.1.9",
165+
"hashPath": "microsoft.bcl.1.1.9.nupkg.sha512"
166+
},
167+
"Microsoft.Bcl.Async/1.0.168": {
168+
"type": "package",
169+
"serviceable": true,
170+
"sha512": "sha512-tUNC02eBwDKpGre0BcNIvblLv1q0Q3DnS/vtkRHj2FE1sXwt386HAudztyl5C0U88hllrqHDvtlz8bK0Y8cHDA==",
171+
"path": "microsoft.bcl.async/1.0.168",
172+
"hashPath": "microsoft.bcl.async.1.0.168.nupkg.sha512"
173+
},
174+
"Microsoft.Bcl.Build/1.0.14": {
175+
"type": "package",
176+
"serviceable": true,
177+
"sha512": "sha512-cDLKSvNvRa519hplsbSoYqO69TjdDIhfjtKUM0g20/nVROoWsGav9KCI9HtnGjLmdV1+TcUUDhbotcllibjPEA==",
178+
"path": "microsoft.bcl.build/1.0.14",
179+
"hashPath": "microsoft.bcl.build.1.0.14.nupkg.sha512"
180+
},
181+
"Microsoft.Net.Http/2.2.28": {
182+
"type": "package",
183+
"serviceable": true,
184+
"sha512": "sha512-hPL9k+rPIpAj84RZSq3WtJkOD9uMStBovAIAz/0OQ+9hQIwQ2XqQlAhMqI4kw0XDxweJySIqNTMlkhRRuthcPQ==",
185+
"path": "microsoft.net.http/2.2.28",
186+
"hashPath": "microsoft.net.http.2.2.28.nupkg.sha512"
187+
},
188+
"Microsoft.Win32.SystemEvents/7.0.0": {
189+
"type": "package",
190+
"serviceable": true,
191+
"sha512": "sha512-2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==",
192+
"path": "microsoft.win32.systemevents/7.0.0",
193+
"hashPath": "microsoft.win32.systemevents.7.0.0.nupkg.sha512"
194+
},
195+
"Newtonsoft.Json/6.0.4": {
196+
"type": "package",
197+
"serviceable": true,
198+
"sha512": "sha512-FyQLmEpjsCrEP+znauLDGAi+h6i9YnaMkITlfIoiM4RYyX3nki306bTHsr/0okiIvIc7BJhQTbOAIZVocccFUw==",
199+
"path": "newtonsoft.json/6.0.4",
200+
"hashPath": "newtonsoft.json.6.0.4.nupkg.sha512"
201+
},
202+
"System.Drawing.Common/7.0.0": {
203+
"type": "package",
204+
"serviceable": true,
205+
"sha512": "sha512-KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==",
206+
"path": "system.drawing.common/7.0.0",
207+
"hashPath": "system.drawing.common.7.0.0.nupkg.sha512"
208+
},
209+
"System.Security.Permissions/7.0.0": {
210+
"type": "package",
211+
"serviceable": true,
212+
"sha512": "sha512-Vmp0iRmCEno9BWiskOW5pxJ3d9n+jUqKxvX4GhLwFhnQaySZmBN2FuC0N5gjFHgyFMUjC5sfIJ8KZfoJwkcMmA==",
213+
"path": "system.security.permissions/7.0.0",
214+
"hashPath": "system.security.permissions.7.0.0.nupkg.sha512"
215+
},
216+
"System.Windows.Extensions/7.0.0": {
217+
"type": "package",
218+
"serviceable": true,
219+
"sha512": "sha512-bR4qdCmssMMbo9Fatci49An5B1UaVJZHKNq70PRgzoLYIlitb8Tj7ns/Xt5Pz1CkERiTjcVBDU2y1AVrPBYkaw==",
220+
"path": "system.windows.extensions/7.0.0",
221+
"hashPath": "system.windows.extensions.7.0.0.nupkg.sha512"
222+
}
223+
}
224+
}
7 KB
Binary file not shown.
145 KB
Binary file not shown.
11.4 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "net6.0",
4+
"framework": {
5+
"name": "Microsoft.NETCore.App",
6+
"version": "6.0.0"
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// <autogenerated />
2+
using System;
3+
using System.Reflection;
4+
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
145 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
using System;
11+
using System.Reflection;
12+
13+
[assembly: System.Reflection.AssemblyCompanyAttribute("teste")]
14+
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
15+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
17+
[assembly: System.Reflection.AssemblyProductAttribute("teste")]
18+
[assembly: System.Reflection.AssemblyTitleAttribute("teste")]
19+
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
20+
21+
// Gerado pela classe WriteCodeFragment do MSBuild.
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f774de976e2d9d037f3924e04049d170492d7fa2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
is_global = true
2+
build_property.TargetFramework = net6.0
3+
build_property.TargetPlatformMinVersion =
4+
build_property.UsingMicrosoftNETSdkWeb =
5+
build_property.ProjectTypeGuids =
6+
build_property.InvariantGlobalization =
7+
build_property.PlatformNeutralAssembly =
8+
build_property._SupportedPlatformList = Linux,macOS,Windows
9+
build_property.RootNamespace = teste
10+
build_property.ProjectDir = C:\Users\Rafael\Desktop\teste\
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// <auto-generated/>
2+
global using global::System;
3+
global using global::System.Collections.Generic;
4+
global using global::System.IO;
5+
global using global::System.Linq;
6+
global using global::System.Net.Http;
7+
global using global::System.Threading;
8+
global using global::System.Threading.Tasks;
Binary file not shown.
Binary file not shown.

CRUD_Firebase/obj/Debug/net6.0/teste.csproj.CopyComplete

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a7e8b0b5a8b3991ccf9f9a914f99252aab07a20c
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.csproj.AssemblyReference.cache
2+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.GeneratedMSBuildEditorConfig.editorconfig
3+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.AssemblyInfoInputs.cache
4+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.AssemblyInfo.cs
5+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.csproj.CoreCompileInputs.cache
6+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\teste.exe
7+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\teste.deps.json
8+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\teste.runtimeconfig.json
9+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\teste.dll
10+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\teste.pdb
11+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\FireSharp.dll
12+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\Microsoft.Threading.Tasks.Extensions.Desktop.dll
13+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\Microsoft.Threading.Tasks.Extensions.dll
14+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\Microsoft.Threading.Tasks.dll
15+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\System.Net.Http.Extensions.dll
16+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\System.Net.Http.Primitives.dll
17+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\Newtonsoft.Json.dll
18+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.csproj.CopyComplete
19+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.dll
20+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\refint\teste.dll
21+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.pdb
22+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\teste.genruntimeconfig.cache
23+
C:\Users\Rafael\Desktop\teste\obj\Debug\net6.0\ref\teste.dll
24+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\Microsoft.Win32.SystemEvents.dll
25+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\System.Drawing.Common.dll
26+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\System.Security.Permissions.dll
27+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\System.Windows.Extensions.dll
28+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\runtimes\win\lib\net6.0\Microsoft.Win32.SystemEvents.dll
29+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Drawing.Common.dll
30+
C:\Users\Rafael\Desktop\teste\bin\Debug\net6.0\runtimes\win\lib\net6.0\System.Windows.Extensions.dll
7 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
09fa64bf0465fabbbd46bacb4452a14891cc9cf5
11.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)