public async Task <ContactDeleteByIdResponse> DeleteContactByIdAsync(ContactDeleteByIdRequest req) { //Todo: make sure this contact is not reference in any case var result = new ContactDeleteByIdResponse(); req.UpdatedDate = DateTime.Today; result = await _repos.DeleteContactByIdAsync(req); return(result); }
public async Task <ContactDeleteByIdResponse> DeleteContactByIdAsync(ContactDeleteByIdRequest req) { using (var conn = new SqlConnection(_connectionSettings.DefaultConnection)) { var result = new ContactDeleteByIdResponse(); string storeproc = string.Format("[dbo].[usp{0}Delete_New]", req.ContactType); await conn.OpenAsync(); var dynParm = new { ID = req.Id, LastUpdatedBy = req.CurrentUser, LastModifiedDate = req.UpdatedDate }; await conn.ExecuteAsync(storeproc, dynParm, null, null, CommandType.StoredProcedure); return(result); } }