| | |
| | | using HStation.CAL; |
| | | using AutoMapper; |
| | | |
| | | namespace HStation.BLL |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class XhsProjectExtensions : IXhsProjectExtensions |
| | | public class XhsProjectExtensions |
| | | { |
| | | private readonly HStation.CAL.IXhsProjectExtensions _cal = CALCreateHelper.CreateCAL<HStation.CAL.IXhsProjectExtensions>(); |
| | | |
| | | public Task<bool> BulkInserts(List<AddXhsProjectExtensionsInput> list) |
| | | public async Task<bool> BulkInserts(List<Vmo.Xhs.XhsProjectSite> list) |
| | | { |
| | | return _cal.BulkInserts(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, AddXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.Xhs.XhsProjectSite>, List<AddXhsProjectExtensionsInput>>(list); |
| | | return await _cal.BulkInserts(vmoList); ; |
| | | } |
| | | |
| | | public Task<bool> BulkUpdates(List<UpdateXhsProjectExtensionsInput> list) |
| | | public Task<bool> BulkUpdates(List<Vmo.Xhs.XhsProjectSite> list) |
| | | { |
| | | return _cal.BulkUpdates(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, UpdateXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.Xhs.XhsProjectSite>, List<UpdateXhsProjectExtensionsInput>>(list); |
| | | |
| | | return _cal.BulkUpdates(vmoList); |
| | | } |
| | | |
| | | public Task<bool> DeleteAll() |
| | |
| | | return _cal.DeleteByIds(Ids); |
| | | } |
| | | |
| | | public Task<List<XhsProjectExtensionsDto>> GetAll() |
| | | public async Task<List<Vmo.Xhs.XhsProjectSite>> GetAll() |
| | | { |
| | | return _cal.GetAll(); |
| | | var DtoList = await _cal.GetAll(); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<XhsProjectExtensionsDto, Vmo.Xhs.XhsProjectSite>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<XhsProjectExtensionsDto>, List<Vmo.Xhs.XhsProjectSite>>(DtoList); |
| | | return vmoList; |
| | | } |
| | | |
| | | public Task<XhsProjectExtensionsDto> GetByID(long ID) |
| | | public async Task<Vmo.Xhs.XhsProjectSite> GetByID(long ID) |
| | | { |
| | | return _cal.GetByID(ID); |
| | | var Dto = await _cal.GetByID(ID); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<XhsProjectExtensionsDto, Vmo.Xhs.XhsProjectSite>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<XhsProjectExtensionsDto, Vmo.Xhs.XhsProjectSite>(Dto); |
| | | return vmo; |
| | | } |
| | | |
| | | public Task<List<XhsProjectExtensionsDto>> GetByIds(List<long> Ids) |
| | | public async Task<List<Vmo.Xhs.XhsProjectSite>> GetByIds(List<long> Ids) |
| | | { |
| | | return _cal.GetByIds(Ids); |
| | | var DtoList = await _cal.GetByIds(Ids); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<XhsProjectExtensionsDto, Vmo.Xhs.XhsProjectSite>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<XhsProjectExtensionsDto>, List<Vmo.Xhs.XhsProjectSite>>(DtoList); |
| | | |
| | | return vmoList; |
| | | } |
| | | |
| | | public Task<long> Insert(AddXhsProjectExtensionsInput model) |
| | | public Task<long> Insert(Vmo.Xhs.XhsProjectSite model) |
| | | { |
| | | return _cal.Insert(model); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, AddXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<Vmo.Xhs.XhsProjectSite, AddXhsProjectExtensionsInput>(model); |
| | | |
| | | return _cal.Insert(vmo); |
| | | } |
| | | |
| | | public Task<bool> Inserts(List<AddXhsProjectExtensionsInput> list) |
| | | public Task<bool> Inserts(List<Vmo.Xhs.XhsProjectSite> list) |
| | | { |
| | | return _cal.Inserts(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, AddXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.Xhs.XhsProjectSite>, List<AddXhsProjectExtensionsInput>>(list); |
| | | |
| | | return _cal.Inserts(vmoList); |
| | | } |
| | | |
| | | public Task<bool> Update(UpdateXhsProjectExtensionsInput model) |
| | | public Task<bool> Update(Vmo.Xhs.XhsProjectSite model) |
| | | { |
| | | return _cal.Update(model); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, UpdateXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<Vmo.Xhs.XhsProjectSite, UpdateXhsProjectExtensionsInput>(model); |
| | | |
| | | return _cal.Update(vmo); |
| | | } |
| | | |
| | | public Task<bool> Updates(List<UpdateXhsProjectExtensionsInput> list) |
| | | public Task<bool> Updates(List<Vmo.Xhs.XhsProjectSite> list) |
| | | { |
| | | return _cal.Updates(list); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.Xhs.XhsProjectSite, UpdateXhsProjectExtensionsInput>() |
| | | ).CreateMapper(); |
| | | var vmoList = mapper.Map<List<Vmo.Xhs.XhsProjectSite>, List<UpdateXhsProjectExtensionsInput>>(list); |
| | | |
| | | return _cal.Updates(vmoList); |
| | | } |
| | | } |
| | | } |