Skip to content

Commit 2f8acc0

Browse files
Format all *.cs files
1 parent 83f5449 commit 2f8acc0

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

SharpEngine.SQLite/SESQLite.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ public static void AddVersions()
1515
DebugManager.Versions.Add("System.Data.SQLite", "1.0.118");
1616
DebugManager.Versions.Add("SharpEngine.SQLite", "1.0.0");
1717
}
18-
19-
}
18+
}

SharpEngine.SQLite/SQLiteDataTable.cs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ namespace SharpEngine.SQLite;
66
/// <summary>
77
/// Sqlite Data Table
88
/// </summary>
9-
public class SQLiteDataTable<T>: IDataTable where T : new()
9+
public class SQLiteDataTable<T> : IDataTable
10+
where T : new()
1011
{
1112
private List<dynamic> Objects { get; }
12-
13+
1314
/// <summary>
1415
/// Create Data Table from SQLite
1516
/// </summary>
@@ -19,33 +20,37 @@ namespace SharpEngine.SQLite;
1920
public SQLiteDataTable(string dbFile, string version = "3")
2021
{
2122
Objects = new List<dynamic>();
22-
23-
var connection = new SQLiteConnection($"Data Source={dbFile};Version={version};New=True;Compress=True;");
24-
23+
24+
var connection = new SQLiteConnection(
25+
$"Data Source={dbFile};Version={version};New=True;Compress=True;"
26+
);
27+
2528
connection.Open();
26-
29+
2730
var cmd = connection.CreateCommand();
2831
cmd.CommandText = $"SELECT * FROM {typeof(T).Name};";
2932
var reader = cmd.ExecuteReader();
3033
while (reader.Read())
3134
{
3235
var obj = new T();
33-
36+
3437
var index = 0;
3538
foreach (var property in typeof(T).GetProperties())
3639
{
37-
if(reader.IsDBNull(index))
40+
if (reader.IsDBNull(index))
3841
property.SetValue(obj, null);
39-
else if(property.PropertyType == typeof(string))
42+
else if (property.PropertyType == typeof(string))
4043
property.SetValue(obj, reader.GetString(index));
41-
else if(property.PropertyType == typeof(int))
44+
else if (property.PropertyType == typeof(int))
4245
property.SetValue(obj, reader.GetInt32(index));
43-
else if(property.PropertyType == typeof(bool))
46+
else if (property.PropertyType == typeof(bool))
4447
property.SetValue(obj, reader.GetBoolean(index));
4548
else if (property.PropertyType == typeof(float))
4649
property.SetValue(obj, reader.GetFloat(index));
4750
else
48-
throw new NotImplementedException($"Not implemented type : {property.PropertyType.Name}");
51+
throw new NotImplementedException(
52+
$"Not implemented type : {property.PropertyType.Name}"
53+
);
4954
index++;
5055
}
5156
Objects.Add(obj);
@@ -58,4 +63,4 @@ public SQLiteDataTable(string dbFile, string version = "3")
5863
{
5964
return Objects.Find(predicate);
6065
}
61-
}
66+
}

Testing/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// See https://aka.ms/new-console-template for more information
22

3-
Console.WriteLine("Hello, World!");
3+
Console.WriteLine("Hello, World!");

0 commit comments

Comments
 (0)