using Microsoft.Extensions.Logging; using SlnMesnac.Common; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service.@base; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; namespace SlnMesnac.Repository.service.Impl { public class T_RP_StationPara_130ServiceImpl : BaseServiceImpl, IT_RP_StationPara_130Service { private Repository _repository; private ILogger _logger; public T_RP_StationPara_130ServiceImpl(Repository repository, ILogger logger) :base(repository) { _repository = repository; _logger = logger; } public async Task AddTaskAsync(List record) { try { bool result = await _repository.InsertRangeAsync(record); return result; } catch (Exception ex) { return false; } } public async Task GetResultAsync(string jpcode) { try { Expression> exp = x => true; exp = exp.And(x => (x.scanbarcode == jpcode) ); var result = await _repository.GetFirstAsync(exp); return result; } catch (Exception ex) { return null; } } public async Task UpdateResultAsync(T_RP_StationPara_130 t_RP_StationPara_110_1) { try { bool result = await _repository.UpdateAsync(t_RP_StationPara_110_1); return result; } catch (Exception ex) { return false; } } } }