Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 1 extra #10

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
05ed9ee
Moved data store service
ilievmark Jul 9, 2023
3f60f95
Updated git ignore
ilievmark Jul 9, 2023
e01641e
Added task page to shell
ilievmark Jul 9, 2023
0f25278
Added api test buttons
ilievmark Jul 9, 2023
9f0433c
Added api interface and actual service
ilievmark Jul 9, 2023
7b16763
Added newton Json nuget
ilievmark Jul 9, 2023
1de2035
Added string parsing ext
ilievmark Jul 9, 2023
27e5419
Added http response parsing extensions
ilievmark Jul 9, 2023
54bbc0f
Added request builder and api service impl
ilievmark Jul 9, 2023
c1b574f
Added dialogs nuget
ilievmark Jul 9, 2023
00593c0
Showing results of api calls
ilievmark Jul 9, 2023
a647ec4
Fixed title for allert
ilievmark Jul 9, 2023
5677cc3
Added user data page form with result fields
ilievmark Jul 9, 2023
931cdb9
Added xaml animations from by own nuget
ilievmark Jul 9, 2023
b681460
Added api bundle level
ilievmark Jul 9, 2023
363d012
Splited app structure on levels
ilievmark Jul 9, 2023
8695f23
Added navigation attributes
ilievmark Jul 9, 2023
096cd7c
Added navigation type registration provider
ilievmark Jul 9, 2023
6c09bc7
Added navigation type registration holders
ilievmark Jul 9, 2023
12f7510
Fixed xamarin essentials
ilievmark Jul 9, 2023
fd4137e
Splitted base view model
ilievmark Jul 9, 2023
32b31a1
Added type resolver with page and view model builders
ilievmark Jul 9, 2023
aa82792
Added navigation service
ilievmark Jul 9, 2023
b4d9548
Refactor navigation system completely
ilievmark Jul 9, 2023
8423088
Removed static variable
ilievmark Jul 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.rsuser
*.suo
*.user
*.idea
*.userosscache
*.sln.docstates

Expand Down
102 changes: 102 additions & 0 deletions UndoAssessment.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.iOS", "UndoA
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment", "UndoAssessment\UndoAssessment\UndoAssessment.csproj", "{7ED4972A-D279-4E63-B4F5-3D15590D4AA1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.Api", "UndoAssessment\UndoAssessment.Api\UndoAssessment.Api.csproj", "{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "App", "App", "{E58169B1-FD07-417D-98B3-46405BF552CB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pages", "Pages", "{BAAC9093-C8DE-4FB7-A84C-DA72A058B55B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.View", "UndoAssessment\UndoAssessment.View\UndoAssessment.View.csproj", "{23CBC56F-5494-435A-A040-222F66F8CC24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.ViewModels", "UndoAssessment\UndoAssessment.ViewModels\UndoAssessment.ViewModels.csproj", "{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.Common", "UndoAssessment\UndoAssessment.Common\UndoAssessment.Common.csproj", "{4B464370-C3EB-4838-AD84-BFF11D628633}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{6E542EEB-D8E0-46B9-A0E5-06DBA6C9CFD2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.Service.Contract", "UndoAssessment\UndoAssessment.Service.Contract\UndoAssessment.Service.Contract.csproj", "{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{EAB717EF-2A1B-4AF5-8212-DDA8666150C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UndoAssessment.Domain", "UndoAssessment\UndoAssessment.Domain\UndoAssessment.Domain.csproj", "{947C30A2-849C-4D97-AD37-0E2366D0F456}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -55,11 +75,93 @@ Global
{7ED4972A-D279-4E63-B4F5-3D15590D4AA1}.Debug|iPhone.Build.0 = Debug|Any CPU
{7ED4972A-D279-4E63-B4F5-3D15590D4AA1}.Release|iPhone.ActiveCfg = Release|Any CPU
{7ED4972A-D279-4E63-B4F5-3D15590D4AA1}.Release|iPhone.Build.0 = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|Any CPU.Build.0 = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Debug|iPhone.Build.0 = Debug|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|iPhone.ActiveCfg = Release|Any CPU
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1}.Release|iPhone.Build.0 = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|Any CPU.Build.0 = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Debug|iPhone.Build.0 = Debug|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|iPhone.ActiveCfg = Release|Any CPU
{23CBC56F-5494-435A-A040-222F66F8CC24}.Release|iPhone.Build.0 = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|Any CPU.Build.0 = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Debug|iPhone.Build.0 = Debug|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|iPhone.ActiveCfg = Release|Any CPU
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC}.Release|iPhone.Build.0 = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|Any CPU.Build.0 = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Debug|iPhone.Build.0 = Debug|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|iPhone.ActiveCfg = Release|Any CPU
{4B464370-C3EB-4838-AD84-BFF11D628633}.Release|iPhone.Build.0 = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|Any CPU.Build.0 = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|Any CPU.ActiveCfg = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|Any CPU.Build.0 = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Debug|iPhone.Build.0 = Debug|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|iPhone.ActiveCfg = Release|Any CPU
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565}.Release|iPhone.Build.0 = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|Any CPU.Build.0 = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|Any CPU.ActiveCfg = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|Any CPU.Build.0 = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Debug|iPhone.Build.0 = Debug|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|iPhone.ActiveCfg = Release|Any CPU
{947C30A2-849C-4D97-AD37-0E2366D0F456}.Release|iPhone.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE885A8A-A7E6-4B1F-B67D-4F92FA75BBE7}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4F77CCCB-68DC-4CC7-A528-DB6FF48741D0} = {E58169B1-FD07-417D-98B3-46405BF552CB}
{B08F8340-7FAF-4AB2-A9DA-BA5B14FE5FDE} = {E58169B1-FD07-417D-98B3-46405BF552CB}
{23CBC56F-5494-435A-A040-222F66F8CC24} = {BAAC9093-C8DE-4FB7-A84C-DA72A058B55B}
{0CF8DD02-FE81-4B6A-BA6D-A64752361ECC} = {BAAC9093-C8DE-4FB7-A84C-DA72A058B55B}
{43EB5F9C-C7BE-48FA-8EBF-E3C87C4F3FE1} = {6E542EEB-D8E0-46B9-A0E5-06DBA6C9CFD2}
{885B0474-90D1-4C57-8AD7-7B0F3CB2E565} = {6E542EEB-D8E0-46B9-A0E5-06DBA6C9CFD2}
{4B464370-C3EB-4838-AD84-BFF11D628633} = {EAB717EF-2A1B-4AF5-8212-DDA8666150C8}
{947C30A2-849C-4D97-AD37-0E2366D0F456} = {EAB717EF-2A1B-4AF5-8212-DDA8666150C8}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion UndoAssessment/UndoAssessment.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;

using Acr.UserDialogs;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
Expand All @@ -16,6 +16,7 @@ protected override void OnCreate(Bundle savedInstanceState)

Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
UserDialogs.Init(this);
LoadApplication(new App());
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
Expand Down
30 changes: 30 additions & 0 deletions UndoAssessment/UndoAssessment.Api/Extensions/HttpExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace UndoAssessment.Api.Extensions
{
public static class HttpExtensions
{
public static HttpRequestBuilder CreateRequest(this HttpClient client)
=> new HttpRequestBuilder(client);

public static HttpContent ToHttpContent(this object requestBody)
{
var result = default(HttpContent);

if (requestBody is HttpContent content)
{
result = content;
}
else
{
var jsonString = JsonConvert.SerializeObject(requestBody ?? new object(), new IsoDateTimeConverter());
result = new StringContent(jsonString, Encoding.UTF8, "application/json");
}

return result;
}
}
}
63 changes: 63 additions & 0 deletions UndoAssessment/UndoAssessment.Api/Extensions/HttpRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

namespace UndoAssessment.Api.Extensions
{
public class HttpRequestBuilder
{
private readonly HttpClient _client;

private HttpRequestMessage _buildingRequest;
private CancellationToken _cancellationToken;

public HttpRequestBuilder(HttpClient client)
{
_client = client;

_buildingRequest = new HttpRequestMessage();
}

public HttpRequestBuilder ByResource(string address, string resource, params object[] parameters)
{
var url = address + string.Format(resource, parameters);
_buildingRequest.RequestUri = new Uri(url);
return this;
}

public HttpRequestBuilder WithMethod(HttpMethod method)
{
_buildingRequest.Method = method;
return this;
}

public HttpRequestBuilder WithContent(object content)
{
_buildingRequest.Content = content.ToHttpContent();
return this;
}

public HttpRequestBuilder WithHeader(string type, string val)
{
_buildingRequest.Headers.Add(type, val);
return this;
}

public async Task<HttpResponseMessage> MakeRequestAsync()
{
try
{
return await _client.SendAsync(_buildingRequest, _cancellationToken);
}
catch (Exception e)
{
if (Debugger.IsAttached)
Debugger.Break();
Console.WriteLine(e);
throw;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Net.Http;
using System.Threading.Tasks;

namespace UndoAssessment.Api.Extensions
{
public static class HttpResponseMessageExtensions
{
public static async Task<T> ReadContentAsJsonAsync<T>(this Task<HttpResponseMessage> taskMessage)
=> await (await taskMessage).ReadContentAsJsonAsync<T>();

public static async Task<T> ReadContentAsJsonAsync<T>(this HttpResponseMessage message)
=> (await message.ReadAsStringAsync()).ParseAsJson<T>();

public static Task<string> ReadAsStringAsync(this HttpResponseMessage message)
=> message.Content.ReadAsStringAsync();
}
}
11 changes: 11 additions & 0 deletions UndoAssessment/UndoAssessment.Api/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace UndoAssessment.Api.Extensions
{
public static class StringExtensions
{
public static T ParseAsJson<T>(this string str)
=> JsonConvert.DeserializeObject<T>(str, converters: new JsonConverter[] { new IsoDateTimeConverter() });
}
}
11 changes: 11 additions & 0 deletions UndoAssessment/UndoAssessment.Api/IApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Threading.Tasks;
using UndoAssessment.Common.Models;

namespace UndoAssessment.Api
{
public interface IApiService
{
Task<ApiResponse> SuccessAsync();
Task<ApiResponse> ErrorAsync();
}
}
35 changes: 35 additions & 0 deletions UndoAssessment/UndoAssessment.Api/TaskApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Net.Http;
using System.Threading.Tasks;
using UndoAssessment.Api.Extensions;
using UndoAssessment.Common.Models;

namespace UndoAssessment.Api
{
public class TaskApiService : IApiService
{
private const string ApiEndpoint = "https://malkarakundostagingpublicapi.azurewebsites.net";

private readonly HttpClient _client;

public TaskApiService()
{
_client = new HttpClient();
}

public Task<ApiResponse> SuccessAsync()
=> _client
.CreateRequest()
.ByResource(ApiEndpoint, "/success")
.WithMethod(HttpMethod.Get)
.MakeRequestAsync()
.ReadContentAsJsonAsync<ApiResponse>();

public Task<ApiResponse> ErrorAsync()
=> _client
.CreateRequest()
.ByResource(ApiEndpoint, "/fail")
.WithMethod(HttpMethod.Get)
.MakeRequestAsync()
.ReadContentAsJsonAsync<ApiResponse>();
}
}
14 changes: 14 additions & 0 deletions UndoAssessment/UndoAssessment.Api/UndoAssessment.Api.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\UndoAssessment.Common\UndoAssessment.Common.csproj" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions UndoAssessment/UndoAssessment.Common/Models/ApiResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

namespace UndoAssessment.Common.Models
{
public class ApiResponse
{
public string Message { get; set; }
public DateTime Date { get; set; }
public int ErrorCode { get; set; }

public override string ToString()
{
var errorLine = ErrorCode > 0 ? $"ErrorCode: {ErrorCode}" : "";
return
$"Message: {Message}\n" +
$"Date: {Date.ToString()}\n" +
errorLine;

}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace UndoAssessment.Models
namespace UndoAssessment.Common.Models
{
public class Item
{
Expand Down
8 changes: 8 additions & 0 deletions UndoAssessment/UndoAssessment.Common/Models/UserData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace UndoAssessment.Common.Models
{
public class UserData
{
public string Name { get; set; }
public int Age { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace UndoAssessment.Common.Navigation
{
public interface INavigationService
{
Task NavigateToRootAsync(string tag, params KeyValuePair<string, object>[] parameters);
Task NavigateAsync(string tag, params KeyValuePair<string, object>[] parameters);
Task NavigateBackAsync(params KeyValuePair<string, object>[] parameters);
}
}
Loading