This commit is contained in:
2026-07-19 12:13:14 +02:00
commit 6337e63a77
46 changed files with 4411 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
using FinlyticCore.Models.Assets;
namespace FinlyticAssets.Models;
public class AssetsCount
{
public int Stock { get; set; }
public int Funds { get; set; }
public int Derivatives { get; set; }
public int Crypto { get; set; }
public int Bond { get; set; }
public int GetCountFromType(AssetType type)
{
return type switch
{
AssetType.Stock => Stock,
AssetType.Fund => Funds,
AssetType.Derivative => Derivatives,
AssetType.Crypto => Crypto,
AssetType.Bond => Bond,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
public void SetCountOfType(AssetType type, int count)
{
_ = type switch
{
AssetType.Stock => Stock = count,
AssetType.Fund => Funds = count,
AssetType.Derivative => Derivatives = count,
AssetType.Crypto => Crypto = count,
AssetType.Bond => Bond = count,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
}