Exemplo n.º 1
0
        // Delete Transaction Code
        public async Task Delete(UserDelete delete)
        {
            try
            {
                using (var db = new data.ToDoDbContext())
                {
                    await Delete(db, delete);

                    await db.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                LogFactory.GetLogger().Log(LogLevel.Error, e);
            }
        }
Exemplo n.º 2
0
// Update Transaction Code
        public async Task <UserView> Update(UserUpdate update)
        {
            try
            {
                using (var db = new data.ToDoDbContext())
                {
                    var result = await Update(db, update);

                    await db.SaveChangesAsync();

                    return((UserView)result);
                }
            }
            catch (Exception e)
            {
                LogFactory.GetLogger().Log(LogLevel.Error, e);
                return(null);
            }
        }
        // Add Transaction Code
        public async Task <TaskView> Add(TaskAdd add)
        {
            try
            {
                using (var db = new data.ToDoDbContext())
                {
                    var result = await Add(db, add);

                    await db.SaveChangesAsync();

                    return((TaskView)result);
                }
            }
            catch (Exception e)
            {
                LogFactory.GetLogger().Log(LogLevel.Error, e);
                return(null);
            }
        }