Skip to content

Commit

Permalink
netcoresync_moor + NETCoreSyncServer Samples are ready. Now reorganiz…
Browse files Browse the repository at this point in the history
…e docs + publish packages
  • Loading branch information
aldycool committed Aug 19, 2021
1 parent 6e357f7 commit a3d4b1f
Show file tree
Hide file tree
Showing 257 changed files with 4,958 additions and 45,052 deletions.
32 changes: 6 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "ServerTimeStamp",
"name": "ServerTimeStamp-Server",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "buildServerTimeStamp",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Samples/ServerTimeStamp/WebSample/bin/Debug/net5.0/WebSample.dll",
"args": [],
"cwd": "${workspaceFolder}/Samples/ServerTimeStamp/WebSample",
Expand All @@ -25,10 +25,10 @@
}
},
{
"name": "ServerTimeStamp-ForTesting",
"name": "ServerTimeStamp-Server-ForTesting",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "buildServerTimeStamp",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Samples/ServerTimeStamp/WebSample/bin/Debug/net5.0/WebSample.dll",
"args": [ "clearDatabase=true" ],
"cwd": "${workspaceFolder}/Samples/ServerTimeStamp/WebSample",
Expand All @@ -41,28 +41,8 @@
}
},
{
"name": "Flutter-ServerApp",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Samples/Flutter/ServerApp/bin/Debug/net5.0/ServerApp.dll",
"args": [],
"cwd": "${workspaceFolder}/Samples/Flutter/ServerApp",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "Flutter-ClientApp",
"cwd": "${workspaceFolder}/Samples/Flutter/client_app",
"name": "ServerTimeStamp-Client",
"cwd": "${workspaceFolder}/Samples/ServerTimeStamp/clientsample",
"request": "launch",
"type": "dart",
},
Expand Down
16 changes: 2 additions & 14 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/Samples/Flutter/ServerApp/ServerApp.csproj",
"${workspaceFolder}/Samples/ServerTimeStamp/WebSample/WebSample.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -19,7 +19,7 @@
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Samples/Flutter/ServerApp/ServerApp.csproj",
"${workspaceFolder}/Samples/ServerTimeStamp/WebSample/WebSample.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -32,18 +32,6 @@
"args": [
"watch",
"run",
"${workspaceFolder}/Samples/Flutter/ServerApp/ServerApp.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "buildServerTimeStamp",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Samples/ServerTimeStamp/WebSample/WebSample.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
Expand Down
7 changes: 7 additions & 0 deletions NETCoreSyncServer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NETCoreSyncServer

The server-side .NET Core Server that hosts the synchronization data middleware for Flutter clients that uses the `netcoresync_moor` package. Implemented in .NET 5, and WebSockets for the data communication.

## Getting Started

To know more of how this middleware works, read the `netcoresync_moor`'s README.
2 changes: 1 addition & 1 deletion NETCoreSyncServer/SyncEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ virtual public dynamic PopulateServerData(Type type, Dictionary<string, object?>
{
// The current Moor's default implementation of toJson() is converting DateTime to epoch milliseconds (in the _DefaultValueSerializer class).
// We now attempt to detect such condition for DateTime type.
if (property.PropertyType == typeof(DateTime) && ((JsonElement)value).ValueKind == JsonValueKind.Number)
if ((property.PropertyType == typeof(DateTime) || property.PropertyType == typeof(DateTime?)) && ((JsonElement)value).ValueKind == JsonValueKind.Number)
{
value = DateTimeOffset.FromUnixTimeMilliseconds(((JsonElement)value).GetInt64()).LocalDateTime;
}
Expand Down
37 changes: 0 additions & 37 deletions Samples/Flutter/ServerApp/Controllers/HomeController.cs

This file was deleted.

35 changes: 0 additions & 35 deletions Samples/Flutter/ServerApp/Controllers/SetupController.cs

This file was deleted.

196 changes: 0 additions & 196 deletions Samples/Flutter/ServerApp/Controllers/SyncAreaController.cs

This file was deleted.

Loading

0 comments on commit a3d4b1f

Please sign in to comment.