forked from ddrilling/AsbCloudServer
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
|
using AsbWitsInfo;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace AsbCloudInfrastructure.Services
|
|||
|
{
|
|||
|
public class WitsInfoService
|
|||
|
{
|
|||
|
private readonly InfoService witsInfoService;
|
|||
|
public WitsInfoService(IEnumerable<ItemInfo>? customItems = null, IEnumerable<RecordInfo>? customRecords = null)
|
|||
|
{
|
|||
|
witsInfoService = new InfoService(customItems, customRecords);
|
|||
|
}
|
|||
|
|
|||
|
public object GetItems(int idRecord = -1)
|
|||
|
{
|
|||
|
object items;
|
|||
|
if(idRecord > 0)
|
|||
|
items = witsInfoService.ItemInfoStore.Where(i => i.RecordId == idRecord);
|
|||
|
else
|
|||
|
items = witsInfoService.ItemInfoStore.Where(i => true);
|
|||
|
return items;
|
|||
|
}
|
|||
|
|
|||
|
public object GetRecords(int idRecord = -1)
|
|||
|
{
|
|||
|
object items;
|
|||
|
if (idRecord > 0)
|
|||
|
items = witsInfoService.RecordInfoStore.Where(i => i.RecordId == idRecord);
|
|||
|
else
|
|||
|
items = witsInfoService.RecordInfoStore.Where(i => true);
|
|||
|
return items;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|