public void DeleteProfile(int id) { BillingSystemContext context = new BillingSystemContext(); Profile profile = context.Profiles.FirstOrDefault(p => p.IDNumber == id); ProfileDAO dao = new ProfileDAO(); dao.Delete(profile); }
public virtual OperationResult Delete(Profile profile) { try { using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled); _dao.Delete(profile); transactionScope.Complete(); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }