Пример #1
0
        public static BaseActionResult DeleteUserAccessToken(UserAccessToken obj4delete)
        {
            using (var context = new XiaoluEntities())
            {
                string msg;
                var    repository = new UserAccessTokenRepository(context);

                if (obj4delete == null)
                {
                    msg = string.Format(XiaoluResources.MSG_DELETE_SUCCESS, XiaoluResources.STR_USER_ACCESS_TOKEN) + string.Format(XiaoluResources.STR_FAIL_RESAON, XiaoluResources.MSG_OBJECT_IS_NULL);
                    return(new BaseActionResult(false, msg));
                }
                repository.Delete(obj4delete);
                context.SaveChanges();
                msg = string.Format(XiaoluResources.MSG_UPDATE_SUCCESS, obj4delete.AccessToken);
                return(new BaseActionResult(true, msg));
            }
        }
        public static BaseActionResult DeleteUserAccessToken(UserAccessToken obj4delete)
        {
            using (var context = new XiaoluEntities())
            {
                string msg;
                var repository = new UserAccessTokenRepository(context);

                if (obj4delete == null)
                {
                    msg = string.Format(XiaoluResources.MSG_DELETE_SUCCESS, XiaoluResources.STR_USER_ACCESS_TOKEN) + string.Format(XiaoluResources.STR_FAIL_RESAON, XiaoluResources.MSG_OBJECT_IS_NULL);
                    return new BaseActionResult(false, msg);
                }
                repository.Delete(obj4delete);
                context.SaveChanges();
                msg = string.Format(XiaoluResources.MSG_UPDATE_SUCCESS, obj4delete.AccessToken);
                return new BaseActionResult(true, msg);
            }
        }