Skip to content

Commit d5fe65a

Browse files
Minor fixes
1 parent 0623608 commit d5fe65a

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/Repository/bin
1111
/.vs/AccountOwnerServer/v16
1212
/AccountOwnerServer/*.user
13+
/.vs/AccountOwnerServer/DesignTimeBuild/*.dtbcache

AccountOwnerServer/Controllers/OwnerController.cs

-6
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ public IActionResult DeleteOwner(Guid id)
177177
return NotFound();
178178
}
179179

180-
if (_repository.Account.AccountsByOwner(id).Any())
181-
{
182-
_logger.LogError($"Cannot delete owner with id: {id}. It has related accounts. Delete those accounts first");
183-
return BadRequest("Cannot delete owner. It has related accounts. Delete those accounts first");
184-
}
185-
186180
_repository.Owner.DeleteOwner(owner);
187181
_repository.Save();
188182

AccountOwnerServer/MappingProfile.cs

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public MappingProfile()
1818
CreateMap<OwnerForCreationDto, Owner>();
1919

2020
CreateMap<OwnerForUpdateDto, Owner>();
21+
22+
CreateMap<AccountForCreationDto, Account>();
23+
24+
CreateMap<AccountForUpdateDto, Account>();
2125
}
2226
}
2327
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace Entities.DataTransferObjects
4+
{
5+
public class AccountForCreationDto
6+
{
7+
public DateTime DateCreated { get; set; }
8+
public string AccountType { get; set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace Entities.DataTransferObjects
4+
{
5+
public class AccountForUpdateDto
6+
{
7+
public DateTime DateCreated { get; set; }
8+
public string AccountType { get; set; }
9+
}
10+
}

0 commit comments

Comments
 (0)