public async Task <IActionResult> Add(Supplier entity) { try { if (entity.Address != null) { entity.Address.AddressType = "Supplier"; var res = await _repo.AddSupplierAsync(entity); return(Ok("Record Added")); } return(BadRequest("Supplier can not be null.")); } catch (Exception ex) { throw; } }