Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "defacto"

Sorry it was our mistake. I saw that in DbContextModelSnapshot, ObjectiveId of DevelopmentObjectiveCategoryMapping is described as Unique like b.HasIndex("ObjectiveId").IsUnique().

Thank you for your fast reply!

Thanks bro!

Dear friend, thanks for your reply. Below is my insert method and it works with navigation props.

[AbpAuthorize (AppPermissions.Pages_PerformanceManagement_Objectives_Create)]
private async Task Create (CreateOrEditObjectiveDto input) {
    var objective = ObjectMapper.Map<Objective> (input);

    if (AbpSession.TenantId != null)
        objective.TenantId = AbpSession.TenantId;

    await _objectiveRepository.InsertAsync (objective);
}

Problem is with update method for navigation props. I thought i did something wrong and that's why i'm having this problem. I refactored my code as you recommended, below it is. But i'm totally not sure if it's good practice. There should be a native support for this. If i can find, i will share it with you.

[AbpAuthorize(AppPermissions.Pages_PerformanceManagement_Objectives_Edit)]
private async Task Update(CreateOrEditObjectiveDto input)
{
    var objective = await _objectiveRepository.FirstOrDefaultAsync((long)input.Id);
    ObjectMapper.Map(input, objective);

    await _objectiveRepository.UpdateAsync(objective);

    await UpdateToleranceLimits(input);
}

[AbpAuthorize(AppPermissions.Pages_PerformanceManagement_Objectives_Edit)]
private async Task UpdateToleranceLimits(CreateOrEditObjectiveDto input)
{
    foreach (var toleranceLimitDto in input.ToleranceLimits)
        await _objectiveToleranceLimitRepository.UpdateAsync(
            ObjectMapper.Map<ObjectiveToleranceLimit>(toleranceLimitDto));
}

If you want to update in the Update method, You first need to query the relevant ObjectiveToleranceLimit.

Could you please show me how to do it?

Sure dude:) Here it is.

Can i take this responsibility?:)

Showing 1 to 6 of 6 entries