Example #1
0
        /* Confirm User */
        public async Task<OpObject> ConfirmUser(String ConfirmationId)
        {
            /* Create return object */
            IsolatedContext IsoContext = new IsolatedContext();

            /* Execute function */
            return await Execute(new Func<Task>(async () =>
            {
                /* Get user guid */
                String uGuid = "0";
                using (MaintienceRepository MainRepo = new MaintienceRepository())
                {
                    /* Delete */
                    uGuid = await MainRepo.DeleteCode(ConfirmationId);
                }

                /* Sanity */
                if (uGuid == "0")
                {
                    IsoContext.RetObj = new OpObject(StatusCode.InvalidParameters);
                    return;
                }

                /* Access user repo */
                using (UserRepository UserRepo = new UserRepository())
                {
                    /* Confirm the user */
                    IsoContext.RetObj = await UserRepo.Confirm(uGuid);
                }
            }), IsoContext);
        }