public bool Create(ContactDto contactDto) { bool isCreate = false; if (contactDto != null) { using (InDesignContext context = new InDesignContext()) { context.Contact.Add(contactDto.contact); int save = context.SaveChanges(); if (save > 0) { isCreate = true; } else { isCreate = false; } } } return(isCreate); }
public bool Update(ClientDto clientDto) { bool isUpdate = false; if (clientDto != null) { using (InDesignContext context = new InDesignContext()) { context.Client.Update(clientDto.client); int save = context.SaveChanges(); if (save > 0) { isUpdate = true; } else { isUpdate = false; } } } return(isUpdate); }