Hi,
I am new to this topic and I am unable to find a solution for the below. I want to set up one property value with some string.
SetProperties(IEnumerable
Pls. post your suggestions.
Hi,
I am new to this topic and I am unable to find a solution for the below. I want to set up one property value with some string.
SetProperties(IEnumerable
Pls. post your suggestions.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
arun kumar42 reputationPosted Aug 29, 2023, 5:36 AM EDT
Hi,
First of all thanks for your suggestion.
But I am unable to call the function .
Mohammad HussainRank #513 · 4.8K reputationPosted Aug 28, 2023, 9:56 AM EDT
using System.Collections.Generic; public class DeliverableProperty { public string Name { get; set; } public string Value { get; set; } } public class Drawing { public List CustomProperties { get; set; } // Other properties and methods for the Drawing class public void SetProperties(IEnumerable propertiesList) { CustomProperties.AddRange(propertiesList); } } class Program { static void Main(string[] args) { Drawing drawing = new Drawing(); List propertiesList = new List { new DeliverableProperty { Name = "Property1", Value = "Value1" }, new DeliverableProperty { Name = "Property2", Value = "Value2" } }; drawing.SetProperties(propertiesList); // Now the drawing object has the custom properties set } }Cr BhargaviRank #420 · 5.9K reputationPosted Aug 28, 2023, 11:37 PM EDT
public class DeliverableProperty { public string PropertyName { get; set; } public string PropertyValue { get; set; } } public class YourClass { public void SetProperties(IEnumerable propertiesList, string newValue) { foreach (var property in propertiesList) { property.PropertyValue = newValue; } } }