Reputation: 13
I want to build Web API project using with seperate Model class library. But I have confused about ClassLibrary and PortableClassLibrary. Which library is perfect for web api project.
Upvotes: 0
Views: 99
Reputation: 1497
Portable class libraries help you if you are developing cross platform apps / libraries. For an example if you are developing Windows Phone / Windows 8 / WPF / Silverlight apps and these apps consume data through Web API that you are developing right now, most probably you want to use same model classes you are having in your Web API project. In such scenario portable libraries will help you reduce the time and costs of developing and testing code.
But if you are developing your API for third parties that you are not aware of (do not have control over), or you want to consume these APIs from non .NET platforms (such as Web pages , android, iOS etc..) then you would not want your model library to be portable.
Follow this MSDN article for more details
Upvotes: 1