Пример #1
0
        protected virtual async Task Create(CreateOrEditBeaconDto input)
        {
            var beacon = ObjectMapper.Map <Beacon>(input);



            await _beaconRepository.InsertAsync(beacon);
        }
Пример #2
0
 public async Task CreateOrEdit(CreateOrEditBeaconDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
Пример #3
0
        protected virtual async Task Update(CreateOrEditBeaconDto input)
        {
            var beacon = await _beaconRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, beacon);
        }