Shuxia Ning
2024-08-12 d2cee56db11f0ee475e9f9dbdc8bfd03ad982e18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
namespace HStation.CAL.LocalClient
{
    /// <summary>
    /// 报警等级
    /// </summary>
    public class XhsProjectStd : IXhsProjectStd
    {
        private readonly HStation.Service.XhsProject _service = new();
 
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<List<XhsProjectStdDto>> GetAll()
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetAll();
                var vm_list = list?.Select(x => new XhsProjectStdDto(x)).ToList();
                return vm_list;
            });
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<XhsProjectStdDto> GetByID(long ID)
        {
 
            return await Task.Run(() =>
            {
                var model = _service.GetByID(ID);
                return model == null ? null : new XhsProjectStdDto(model);
            });
        }
    }
}