using AutoMapper;
|
using System.Collections.Generic;
|
using Yw;
|
|
namespace HStation.BLL
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class ExchangerPartPropContent
|
{
|
private readonly HStation.CAL.IAssetsExchangerPropContent _cal = CALCreateHelper.CreateCAL<HStation.CAL.IAssetsExchangerPropContent>();
|
|
#region Query
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<List<Vmo.AssetsExchangerPropContentVmo>> GetAll()
|
{
|
var DtoList = await _cal.GetAll();
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.AssetsExchangerPropContentDto, Vmo.AssetsExchangerPropContentVmo>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Dto.Assets.AssetsExchangerPropContentDto>, List<Vmo.AssetsExchangerPropContentVmo>>(DtoList);
|
|
return vmoList;
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<Vmo.AssetsExchangerPropContentVmo> GetByID(long ID)
|
{
|
var Dto = await _cal.GetByID(ID);
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.AssetsExchangerPropContentDto, Vmo.AssetsExchangerPropContentVmo>()
|
).CreateMapper();
|
var vmo = mapper.Map<Dto.Assets.AssetsExchangerPropContentDto, Vmo.AssetsExchangerPropContentVmo>(Dto);
|
|
return vmo;
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<List<Vmo.AssetsExchangerPropContentVmo>> GetByIds(List<long> Ids)
|
{
|
var DtoList = await _cal.GetByIds(Ids);
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.AssetsExchangerPropContentDto, Vmo.AssetsExchangerPropContentVmo>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Dto.Assets.AssetsExchangerPropContentDto>, List<Vmo.AssetsExchangerPropContentVmo>>(DtoList);
|
return vmoList;
|
}
|
|
public async Task<List<Vmo.AssetsExchangerPropContentVmo>> GetByExchangerPartID(long ExchangerPartId)
|
{
|
var DtoList = await _cal.GetByExchangerPartID(ExchangerPartId);
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.AssetsExchangerPropContentDto, Vmo.AssetsExchangerPropContentVmo>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Dto.Assets.AssetsExchangerPropContentDto>, List<Vmo.AssetsExchangerPropContentVmo>>(DtoList);
|
|
return vmoList;
|
}
|
|
#endregion Query
|
|
#region Insert
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<long> Insert(Vmo.AssetsExchangerPropContentVmo model)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, AddAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var vmo = mapper.Map<Vmo.AssetsExchangerPropContentVmo, AddAssetsExchangerPropContentInput>(model);
|
return await _cal.Insert(vmo);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> Inserts(List<Vmo.AssetsExchangerPropContentVmo> list)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, AddAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Vmo.AssetsExchangerPropContentVmo>, List<AddAssetsExchangerPropContentInput>>(list);
|
|
return await _cal.Inserts(vmoList);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> BulkInserts(List<Vmo.AssetsExchangerPropContentVmo> list)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, AddAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Vmo.AssetsExchangerPropContentVmo>, List<AddAssetsExchangerPropContentInput>>(list);
|
|
return await _cal.BulkInserts(vmoList);
|
}
|
|
#endregion Insert
|
|
#region Update
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> Update(Vmo.AssetsExchangerPropContentVmo model)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, UpdateAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var Vmo = mapper.Map<Vmo.AssetsExchangerPropContentVmo, UpdateAssetsExchangerPropContentInput>(model);
|
|
return await _cal.Update(Vmo);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> Updates(List<Vmo.AssetsExchangerPropContentVmo> list)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, UpdateAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Vmo.AssetsExchangerPropContentVmo>, List<UpdateAssetsExchangerPropContentInput>>(list);
|
|
return await _cal.Updates(vmoList);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> BulkUpdates(List<Vmo.AssetsExchangerPropContentVmo> list)
|
{
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsExchangerPropContentVmo, UpdateAssetsExchangerPropContentInput>()
|
).CreateMapper();
|
var vmoList = mapper.Map<List<Vmo.AssetsExchangerPropContentVmo>, List<UpdateAssetsExchangerPropContentInput>>(list);
|
|
return await _cal.BulkUpdates(vmoList);
|
}
|
|
#endregion Update
|
|
#region Delete
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> DeleteByID(long ID)
|
{
|
return await _cal.DeleteByID(ID);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> DeleteByIds(List<long> Ids)
|
{
|
return await _cal.DeleteByIds(Ids);
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public async Task<bool> DeleteAll()
|
{
|
return await _cal.DeleteAll();
|
}
|
|
#endregion Delete
|
}
|
}
|