properly mapped the updated Dto to contact table
This commit is contained in:
parent
b7a9d6148d
commit
7ae001e277
@ -622,7 +622,19 @@ namespace Marco.Pms.Services.Helpers
|
|||||||
UpdateAt = DateTime.UtcNow
|
UpdateAt = DateTime.UtcNow
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
catch (DbUpdateException dbEx)
|
||||||
|
{
|
||||||
|
|
||||||
|
return ApiResponse<object>.ErrorResponse("User Send empty Payload", new
|
||||||
|
{
|
||||||
|
message = dbEx.Message,
|
||||||
|
innerexcption = dbEx.InnerException.Message
|
||||||
|
}, 400);
|
||||||
|
}
|
||||||
|
|
||||||
contact = await _context.Contacts.Include(c => c.ContactCategory).FirstOrDefaultAsync(c => c.Id == id && c.IsActive && c.TenantId == tenantId) ?? new Contact();
|
contact = await _context.Contacts.Include(c => c.ContactCategory).FirstOrDefaultAsync(c => c.Id == id && c.IsActive && c.TenantId == tenantId) ?? new Contact();
|
||||||
phones = await _context.ContactsPhones.AsNoTracking().Where(p => p.ContactId == contact.Id).ToListAsync();
|
phones = await _context.ContactsPhones.AsNoTracking().Where(p => p.ContactId == contact.Id).ToListAsync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user