开发者

LINQ-to-SQL classes from a select statement

开发者 https://www.devze.com 2023-01-06 11:21 出处:网络
I am a little new to linq-to-sql. I was just thinking suppose you wanted a subset of fields (in your db table) to actually be a data model in your application,开发者_如何学JAVA what do you do? What I

I am a little new to linq-to-sql. I was just thinking suppose you wanted a subset of fields (in your db table) to actually be a data model in your application,开发者_如何学JAVA what do you do? What I have thought of so far is to create a view from the actual db table and build linq-able classes using it.

Or is there a better way of doing this?


try these Walkthrough: Creating LINQ to SQL Classes (O/R Designer)

or these implemented in MVC Creating Model Classes with LINQ to SQL


One option is you can create Anonymous Types and use it.

0

精彩评论

暂无评论...
验证码 换一张
取 消