I think I do have a little tips for you to share. Not very significant tips, but you can use it for your daily practice.
Sometimes when you want to use a logic like this, it’s too long to write code.
Old Code
- if (Fld.Type == SPFieldType.Choice || Fld.Type == SPFieldType.Note || Fld.Type == SPFieldType.Integer || Fld.Type == SPFieldType.Number)
- FieldContent = (string)Li[Fld.Id];
But you can simplify your code using this code below.
Simpler Code
- if (",Text,Note,Choice,Integer,Number,".Contains(Fld.TypeAsString))
- FieldContent = (string)Li[Fld.Id];
Happy coding…!
Tidak ada komentar:
Posting Komentar
[give me your ideas, hopes, comments and compliments below...]
[aaand...... +1 if you need to....]