KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm very new to C# so please bear with me... I'm implementing a partial class, and would like to add two properties like so: public partial class SomeModel { public bool IsSomething { get; set; } public List<string> SomeList { get; set; } ... Additional methods using the above data members ... } I would like to initialize both data members: IsSomething to True and SomeList to new List<string>() . Normally I would do it in a constructor, however because it's a partial class I don't want to touch the constructor (should I?). What's the best way to achieve this? Thanks PS I'm working in ASP.NET MVC, adding functionality to a a certain model, hence the partial class.
Tags (comma-separated)
Save Edits
Cancel