Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPDEV-809 mark employee deleted #49

Merged
merged 3 commits into from
Sep 20, 2018
Merged

Conversation

vitaliidasaev
Copy link

No description provided.

@@ -83,6 +83,18 @@ public async Task<Employee> AddAsync(Employee employee)
return createdEmployee;
}

public async Task MarkDeletedAsync(string merchantId, string employeeId)
{
var employee = await _employeeRepository.GetAsync(employeeId, merchantId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way it will always take from you 2 roundtrips:
1 - check if employee exists
2- delete it
Instead you could just check if MergeAsync returns null and if it does than raise EmployeeNotfoundException.

@vitaliidasaev vitaliidasaev merged commit 9d7dcd8 into test Sep 20, 2018
@vitaliidasaev vitaliidasaev deleted the feature_LPDEV-809-add-isdeleted branch September 20, 2018 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants