forked from LykkeCity/Lykke.Service.Assets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2740b3d
commit cab5a0c
Showing
10 changed files
with
291 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Lykke.Service.Assets.NoSql/Models/WatchListCustomNoSql.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Lykke.Service.Assets.Core.Domain; | ||
using MyNoSqlServer.Abstractions; | ||
|
||
namespace Lykke.Service.Assets.NoSql.Models | ||
{ | ||
public class WatchListCustomNoSql : MyNoSqlDbEntity, IWatchList | ||
{ | ||
public const string TableNameCustomWatchList = "antares.asset.custom-watch-list"; | ||
|
||
public static string GeneratePartitionKey(string clientId) => clientId; | ||
public static string GenerateRowKey(string watchListId) => watchListId; | ||
|
||
public string ClientId { get; set; } | ||
|
||
public List<string> AssetIds { get; set; } | ||
public string Id { get; set; } | ||
public string Name { get; set; } | ||
public int Order { get; set; } | ||
public bool ReadOnly { get; set; } | ||
|
||
IEnumerable<string> IWatchList.AssetIds => AssetIds; | ||
|
||
public static WatchListCustomNoSql Create(string clientId, IWatchList watchList) | ||
{ | ||
return new WatchListCustomNoSql() | ||
{ | ||
PartitionKey = GeneratePartitionKey(clientId), | ||
RowKey = GenerateRowKey(watchList.Id), | ||
Id = watchList.Id, | ||
Name = watchList.Name, | ||
Order = watchList.Order, | ||
ClientId = clientId, | ||
ReadOnly = watchList.ReadOnly, | ||
AssetIds = watchList.AssetIds.ToList() | ||
}; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/Lykke.Service.Assets.NoSql/Models/WatchListPredefinedNoSql.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Lykke.Service.Assets.Core.Domain; | ||
using MyNoSqlServer.Abstractions; | ||
|
||
namespace Lykke.Service.Assets.NoSql.Models | ||
{ | ||
public class WatchListPredefinedNoSql : MyNoSqlDbEntity, IWatchList | ||
{ | ||
public const string TableNamePredefinedWatchList = "antares.asset.predefined-watch-list"; | ||
|
||
public static string GeneratePartitionKey() => "predefined"; | ||
public static string GenerateRowKey(string watchListId) => watchListId; | ||
|
||
public List<string> AssetIds { get; set; } | ||
public string Id { get; set; } | ||
public string Name { get; set; } | ||
public int Order { get; set; } | ||
public bool ReadOnly { get; set; } | ||
|
||
IEnumerable<string> IWatchList.AssetIds => AssetIds; | ||
|
||
public static WatchListPredefinedNoSql Create(IWatchList watchList) | ||
{ | ||
return new WatchListPredefinedNoSql() | ||
{ | ||
PartitionKey = GeneratePartitionKey(), | ||
RowKey = GenerateRowKey(watchList.Id), | ||
Id = watchList.Id, | ||
Name = watchList.Name, | ||
Order = watchList.Order, | ||
ReadOnly = watchList.ReadOnly, | ||
AssetIds = watchList.AssetIds.ToList() | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.