Example #1
0
        public async Task <int> DeleteAsync(int id)
        {
            int Deleted = 0;

            using (var transaction = DbContext.Database.BeginTransaction())
            {
                try
                {
                    await costCalculationGarmentLogic.DeleteAsync(id);

                    Deleted = await DbContext.SaveChangesAsync();

                    transaction.Commit();
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    throw new Exception(e.Message);
                }
            }
            return(Deleted);
        }
Example #2
0
        public async Task <int> DeleteAsync(int id)
        {
            await costCalculationGarmentLogic.DeleteAsync(id);

            return(await DbContext.SaveChangesAsync());
        }