protected virtual async Task UpdateAsync(CreateOrEditDesiredLocationJobDto input) { var entity = await locationJobRepository.GetAll() .FirstOrDefaultAsync(p => p.Id == input.Id); ObjectMapper.Map(input, entity); await locationJobRepository.UpdateAsync(entity); }
protected virtual async Task CreateUserAsync(CreateOrEditDesiredLocationJobDto input) { var entity = ObjectMapper.Map <DesiredLocationJob>(input); await locationJobRepository.InsertAndGetIdAsync(entity); await CurrentUnitOfWork.SaveChangesAsync(); }
//[AbpAuthorize(PermissionNames.AdminPage_DesiredLocationJob)] public async Task CreateOrUpdate(CreateOrEditDesiredLocationJobDto input) { if (input.Id != 0) { await UpdateAsync(input); } else { await CreateUserAsync(input); } }
public async Task <CreateOrEditDesiredLocationJobDto> GetForEdit(int?id) { var model = new CreateOrEditDesiredLocationJobDto(); if (id == null) { return(model); } var entity = await locationJobRepository.GetAll() .FirstOrDefaultAsync(p => p.Id == id); entity.MapTo(model); //model = model.Translations // .Concat(translations) // .DistinctBy(p => p.Language) // .ToList(); return(model); }