Пример #1
0
        public async Task <Result> PermanentDeleteEquipmentAsync(int id)
        {
            try
            {
                var entity = await _dbContext.FindAsync <MedEquipment>(id);

                _dbContext.Remove(entity);
                await _dbContext.SaveChangesAsync();

                return(new SuccessResult(true, "Record has been deleted."));
            }
            catch (Exception ex)
            {
                return(new FailureResult(ex.Message));
            }
        }
Пример #2
0
        public async Task <Result> PermanentDeleteClinicAsync(int id)
        {
            try
            {
                if (id == 0)
                {
                    return(new FailureResult(_sharedLocalizer["IdRequired"]));
                }
                var entity = await _dbContext.FindAsync <MedClinic>(id);

                _dbContext.Remove(entity);
                await _dbContext.SaveChangesAsync();

                return(new SuccessResult(true, _sharedLocalizer["DeleteMessage"]));
            }
            catch
            {
                return(new FailureResult());
            }
        }