properly mapped the updated Dto to contact table
This commit is contained in:
parent
1e70f2bffc
commit
b3ceecaf9e
@ -1915,7 +1915,19 @@ namespace Marco.Pms.Services.Helpers
|
|||||||
UpdateAt = DateTime.UtcNow
|
UpdateAt = DateTime.UtcNow
|
||||||
});
|
});
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
try
|
||||||
|
{
|
||||||
|
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