예제 #1
0
        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);
        }
예제 #2
0
        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
                });
            }
        }