Skip to main content
formatted code
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

Here is how I did it.

if (component.Metadata["distribution_start_date"] != null)
                {
                    distributionStartDate = Convert.ToDateTime(component.Metadata["distribution_start_date"].InnerText);
                }
                if (component.Metadata["distribution_end_date"] != null)
                {
                    distributionEndDate = Convert.ToDateTime(component.Metadata["distribution_end_date"].InnerText);
                }
 
                
                    if (component.Metadata["metadata"]["activation_date"]!=null)
                    {
                        activationDate = Convert.ToDateTime(component.Metadata["metadata"]["activation_date"].InnerText);
                    }
                    if (component.Metadata["metadata"]["expiration_date"]!=null)
                    {
                        expirationDate = Convert.ToDateTime(component.Metadata["metadata"]["expiration_date"].InnerText);
                    }

Here is how I did it.

if (component.Metadata["distribution_start_date"] != null)
                {
                    distributionStartDate = Convert.ToDateTime(component.Metadata["distribution_start_date"].InnerText);
                }
                if (component.Metadata["distribution_end_date"] != null)
                {
                    distributionEndDate = Convert.ToDateTime(component.Metadata["distribution_end_date"].InnerText);
                }
 
                
                    if (component.Metadata["metadata"]["activation_date"]!=null)
                    {
                        activationDate = Convert.ToDateTime(component.Metadata["metadata"]["activation_date"].InnerText);
                    }
                    if (component.Metadata["metadata"]["expiration_date"]!=null)
                    {
                        expirationDate = Convert.ToDateTime(component.Metadata["metadata"]["expiration_date"].InnerText);
                    }

Here is how I did it.

if (component.Metadata["distribution_start_date"] != null)
{
    distributionStartDate = Convert.ToDateTime(component.Metadata["distribution_start_date"].InnerText);
}
if (component.Metadata["distribution_end_date"] != null)
{
    distributionEndDate = Convert.ToDateTime(component.Metadata["distribution_end_date"].InnerText);
}
                
if (component.Metadata["metadata"]["activation_date"]!=null)
{
    activationDate = Convert.ToDateTime(component.Metadata["metadata"]["activation_date"].InnerText);
}
if (component.Metadata["metadata"]["expiration_date"]!=null)
{
    expirationDate = Convert.ToDateTime(component.Metadata["metadata"]["expiration_date"].InnerText);
}
Source Link
AlokBhatt
  • 1.3k
  • 7
  • 13

Here is how I did it.

if (component.Metadata["distribution_start_date"] != null)
                {
                    distributionStartDate = Convert.ToDateTime(component.Metadata["distribution_start_date"].InnerText);
                }
                if (component.Metadata["distribution_end_date"] != null)
                {
                    distributionEndDate = Convert.ToDateTime(component.Metadata["distribution_end_date"].InnerText);
                }

                
                    if (component.Metadata["metadata"]["activation_date"]!=null)
                    {
                        activationDate = Convert.ToDateTime(component.Metadata["metadata"]["activation_date"].InnerText);
                    }
                    if (component.Metadata["metadata"]["expiration_date"]!=null)
                    {
                        expirationDate = Convert.ToDateTime(component.Metadata["metadata"]["expiration_date"].InnerText);
                    }