Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have recently run into a number of issues with SPMetal and LINQ to SharePoint that is making me wonder if it is worth it. In what cases does it make sense to use SPMetal and in what cases does it not work so well?

Areas that I found that require more code/work:

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I avoid it, more work than it's worth. I asked similar a while ago: Frustrated! Linq to SharePoint, choice values, losing spaces. Enjoy the read ;)

share|improve this answer
2  
Mostly avoid use of SPMetal tool. For below reasons: 1. Its difficult to maintain - regeneration required everytime you change the list 2. Unnecessary coding overhead for the above scenarios. –  Anand Apr 24 '13 at 8:34
    
Is there ever a time it is worth using? Like if the lists wont change as users wont have access to them? –  Ryan Erickson Apr 24 '13 at 15:17
    
Meh, the complexity of it all, it's just not worth it. Write a quick CAML query and then you can use Linq on the SPListItemCollection that gets returned for finer tuning or data manipulation. –  David Lozzi Apr 25 '13 at 13:51
    
I just wish there was a better way, queries in CAML are a pain to write and read especially when they get more complex. –  Ryan Erickson Apr 26 '13 at 21:28
    
True, have you seen the CAML Builder tools out there? They help create them much easier. –  David Lozzi Apr 29 '13 at 13:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.