Example #1
0
        internal async Task <bool> ModifyStatusEntry(StatusEntry StatusEntry)
        {
            _context.Entry(StatusEntry).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StatusEntryExists(StatusEntry.Id))
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }
        }
Example #2
0
        internal async Task <bool> ModifyEmployee(Employee employee)
        {
            _context.Entry(employee).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EmployeeExists(employee.Id))
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }
        }