TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Riker
NA
85
16.1k
Can you clear objects while code still running?
Nov 4 2020 4:11 PM
I have some JSON that I deserialize by doing like:
Rootobject rootObject = JsonConvert.DeserializeObject(rawJSON);
That gets put into things like:
public
class
Rootobject
{
public
Result result {
get
;
set
; }
public
bool
success {
get
;
set
; }
}
public
class
Result
{
public
string
title {
get
;
set
; }
public
Datum[] data {
get
;
set
; }
public
int
total {
get
;
set
; }
}
public
class
Datum
{
public
string
type {
get
;
set
; }
public
string
title {
get
;
set
; }
public
string
series_title {
get
;
set
; }
public
string
label {
get
;
set
; }
public
string
content_id {
get
;
set
; }
public
string
airdate {
get
;
set
; }
public
long
airdate_ts {
get
;
set
; }
public
DateTime airdate_iso {
get
;
set
; }
public
string
expiredate_raw {
get
;
set
; }
Everything working great. That said, I want to now run
Rootobject rootObject = JsonConvert.DeserializeObject(rawJSON);
again with a different set of JSON data. Basically a different feed but the exact same layout. Will all the above class objects still have the old data in it and when I loop thru that data will just be appended to it? If so is there a way to clear all values before looping thru the second process without creating two programs that run separately?
Reply
Answers (
2
)
Founding data gridview
Customize Datagridview textboxcolumn + button