I am about to finalize the design of my webapplication, i am building it as an n-tier architecture and i am posed with the question of using DLinq vs EFM. I would appreciate if someone could give me some expert advice on it.
...
Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way.
Consider the following situation :
var query =
from c in db.Customers
where (c.ContactFirstName.Contains("BlackListed") ||
c.ContactLastName.Contains("BlackListed") ||
c.Add...
Hello,
I ran into an interesting problem while using DLINQ. When I instantiate an entity, calling .SubmitChanges() on the DataContext will insert a new row into the database - without having ever called .Insert[All]OnSubmit(...).
//Code sample:
Data.NetServices _netServices = new Data.NetServices(_connString);
Data.ProductOption[] te...
I have a table in a ASP.NET MVC application that I want to be sortable (serverside) and filterable using AJAX. I wanted it to be fairly easy to use in other places and didn't feel like hardcoding the sorting and filtering into query expressions so I looked for a way to build the expressions dynamically and the best way to do this I found...
I'd like to extend the AuthorizeAttribute in ASP.NET MVC so that it supports the concept of a user's authorization being based on their role membership OR "ownership" of the data in question. I'm using LINQ2SQL for data access. There is a similar question at http://stackoverflow.com/questions/390930/asp-net-mvc-authorization-using-roles....
I have a combo box in Silverlight. It has a collection of values built out of the properties of one of my LINQ-to-SQL objects (ie Name, Address, Age, etc...). I would like to filter my results based off the value selected in a combo box.
Example: Say I want everyone with a last name "Smith". I'd select 'Last Name' from the drop down ...
I have had some success getting the MSFT Dynamic Linq stuff to work, but now I need to create a "Where" clause that includes an Attribute.
The error I get is "No applicable aggregate method 'First' exists"
Here is my code:
where = "Element(XName.Get(\"procedure\")).Attributes(XName.Get(\"code\")).First() = \"28002\"";
var q2 = doc.El...
I have a huge query that is being made dynamically, but I want the select statement to not output the column names, buut custom values. FOr example, if I am doing a normal Linq query, I can do something like this:
var v = from p in db.items select new { name = p.item_name, price = p.item_price };
which will give me the nice '.name' a...
I want to build a dlinq query that checks to see if a title has any number of items in it. I know you can do .Contains() with a list, but I need to check if the title contains any of the items, not if the items contain part of the title. For example: I have three items in the list "bacon, chicken, pork." I need the title of "chicken hous...
I have to use LINQ to SQL and along with it a pure SQL classic query. And this SQL query has the Table from where my data will be generated, but I will not know this Table previously. It will be known in compile time.
So how can I make LINQ understand from what Table I want to make the query?
...
I'm using dynamic Linq and have the where clauses working. Now I'm looking to add orderby clauses but am having a problem being able to set the type of the dynamic expression. Below is working code that I have:
class MyClass {
public string Owner;
public DateTime Inserted;
}
Expression<Func<MyClass, bool>> whereExpression = Dyn...
I'm using DbLinq which should be the equivalent of Linq2SQL for this question. I'm need to generate a Linq2SQL query where I specify the columns I want returned at runtime. I can achieve that using the Dynamic Linq extension methods but I can't work out how to extract the result.
string someProperty = "phonenumber";
string id = "1234";
...
Table like
datetime a1 b1 x2 ...
07-01-2009 13:10 8 9 10
07-01-2009 13:11 8 8 2
07-01-2009 13:12 9 1 1
1 row per second for a whole day (=86400 rows); ~40 columns; all same format
I'm looking for a way to retrieve a max value and the time for a column to specify.
I'm looking for a way to...
I have an issue using the Dynamic Expression API. I cannot seem to compare a DataTable field against DBNull.Value. The API is supposed to be able to "support static field or static property access. Any public field or property can be accessed.". However given the following query:
var whatever = table1.AsEnumerable()
...
I have a gallery entity framework class,and I'm attempting to use the Dynamic Linq Library posted on ScottGu's blog to query the entity set.
The failing line of code reads:
return context.Galleries.OrderBy(sidx + " " + sord).Skip(page * rows).Take(rows).ToList();
sidx=="Name", and sord=="desc".
The Gallery object does have a propert...
Hi there,
I've a project which ask me to do such a BUG search engine but which is all dynamic. I mean I can have about 0 to 9 main "group" which have inside something like an infinite possibility of "where" with "OR" or "AND". First thing we think was to use Dynamic Linq which provide a good alternative to build dynamic query. All this ...
Example-I have a person class
Public Class Person
Private _fname As String
Public Property Fname() As String
Get
Return _fname
End Get
Set(ByVal value As String)
_fname = value
End Set
End Property
Private _lname As String
Public Property Lname() As String
Get
Return _lname
End Get
S...
Hi, there is any way to order a query by a many-to-many relation table column in linq? and in scottgu's DynamicLinq?
For example:
Products: p_id, p_name
Product_Order: p_id, o_id, quantity
Order: o_id, o_name
how can I query for order by Product_Order quantity?
from p in model.Products
order by p.Product_Order.quantity
select p
...
I am using the Dynamic Linq Library / Sample from Microsoft to do ordering on a list. So for example I have the following C# code:
myGrid.DataSource=repository.GetWidgetList()
.OrderBy(sortField + " " + sortDirection).ToList();
I have a case where my Object have a 0:1 relationship with another object, which has a property ...
Wikipedia states that the Specification Pattern is where business logic can be recombined by chaining the business logic together using boolean logic. With respect to selecting filtering objects from lists or collections it seems to me that Dynamic LINQ allows me to accomplish the same thing. Am I missing something? Are there other be...