Re: Extending SQL LINQ Table Class



Thanks for your reply Mark,

Do you mean the "LINQ to SQL (Part 8 - Executing Custom SQL Expressions) "
link was broken? If so, you can try searching the subject in web directly.
There are a series of LINQ to SQL articles on ScottGu's blog. They are very
helpful.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: Mark Olbert <ChairmanMAO@xxxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.dotnet.framework
Subject: Re: Extending SQL LINQ Table Class
Date: Mon, 07 Jan 2008 10:33:00 -0800

Steven,

Thanks for the quick reply. You're right, extended properties work fine so
long as you don't try to use them in a query.

I think I saw some references on the web to replacing properties that
don't map to database fields to method calls which can be used
in queries.

BTW, the second link you gave me doesn't work.

- Mark

On Mon, 07 Jan 2008 09:11:13 GMT, stcheng@xxxxxxxxxxxxxxxxxxxx (Steven
Cheng[MSFT]) wrote:

Hi Mark,

I think custom properites with partial class for LINQ object class is
supported. As for the property you added, did you by any chance used it
in
any data query expression? It seems the custom property will not be
recognized in any query expression to the datasource. Or you just get the
compile error without using the property in any place? here is a web
forum
thread mentioned something about add custom property:

#Custom properties in LINQ to SQL classes
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1656614&SiteID=1

and here is a blog article about extending LINQ to SQL query:

#LINQ to SQL (Part 8 - Executing Custom SQL Expressions)
http://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-execu
ti
ng-custom-sql-expressions.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#not
if
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: Mark Olbert <ChairmanMAO@xxxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.dotnet.framework
Subject: Extending SQL LINQ Table Class
Date: Sun, 06 Jan 2008 17:37:00 -0800


I am trying to extend a table entity class (generated from the visual
designer for data contexts) with a property that has no
corresponding column in the underlying Sql Server table.

When I do this, I get a NotSupportedException complaining that the
property I added has no supported translation to the database.

The documentation implies that properties not marked with the Column
attribute will be ignored when interfacing to the
database...but that's not what appears to be happening.

Is there some other attribute I need to decorate the property with to
have
the property "skipped"? Or is it just not possible to add
properties to table entity classes using partial classes? If that's the
case, the documentation should make that clear.

- Mark



.



Relevant Pages

  • =?ISO-8859-1?Q?Extending_Entity_Framework_=A0and_LINQ_to_SQL_Support?= =?ISO-8859-1?
    ... Entity Framework support, LINQ to SQL support, and contain an ORM ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: Association missing in dbml generated classes
    ... How to implement a many-to-many relationship using Linq to Sql? ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: EF or LINQtoSQL and VarBinary Max?
    ... Gregory is correct that in LINQ to SQL, ... System.Data.Linq.Binary or byte, while in LINQ to Entities, it is ... MyImageTable myImage = new MyImageTable ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: linq troubles
    ... > and we're isolating the problem in the ms sql server, ... > set up linq to free the used resources. ... Linq-to-SQL like it will support and enhance the ADO.NET Entity Framework. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Are Linq-SQL methods commutative
    ... No - in LINQ each step effectively works off the result of the ... linq query which has to meet a SQL query they have in mind. ... freedom a SQL statement gives them: the SQL statement is the one ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast