switch to sqlite
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using Billing.Models;
|
||||
using Billing.UI;
|
||||
using Billing.Views;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
@@ -82,7 +85,7 @@ namespace Billing
|
||||
{
|
||||
return new UIBill(b)
|
||||
{
|
||||
Icon = App.Categories.FirstOrDefault(c => c.Id == b.CategoryId)?.Icon ?? BaseModel.ICON_DEFAULT,
|
||||
Icon = App.Categories.FirstOrDefault(c => c.Id == b.CategoryId)?.Icon ?? Definition.DefaultIcon,
|
||||
Name = b.Name,
|
||||
DateCreation = b.CreateTime,
|
||||
Amount = b.Amount,
|
||||
@@ -130,4 +133,24 @@ namespace Billing
|
||||
|
||||
public delegate void PropertyValueChanged<TResult, TOwner>(TOwner obj, TResult old, TResult @new);
|
||||
}
|
||||
|
||||
internal class AsyncLazy<T>
|
||||
{
|
||||
private readonly Lazy<Task<T>> instance;
|
||||
|
||||
public AsyncLazy(Func<T> factory)
|
||||
{
|
||||
instance = new Lazy<Task<T>>(() => Task.Run(factory));
|
||||
}
|
||||
|
||||
public AsyncLazy(Func<Task<T>> factory)
|
||||
{
|
||||
instance = new Lazy<Task<T>>(() => Task.Run(factory));
|
||||
}
|
||||
|
||||
public TaskAwaiter<T> GetAwaiter()
|
||||
{
|
||||
return instance.Value.GetAwaiter();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user