Help me,
I just begin for trying telerik, but i have an error in register the StyleSheetRegistrar,
here is the code :
<%= Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.vista.css"))%>
and return this error : 'group' is a type and cannot be used as an expression.
at last my searching, it told that all caused by lambda problem in VB9.
any solution please?
thanks..
Your searching actually led you to the correct conclusion. There is no lambda support in VB9. The StyleSheetRegistrar (as you see in your question), and all Telerik MVC components, rely on lambda expressions. Really the only way to get around this, from what I know (not a VB.NET expert though ;)), is to utilize VB10 which should have lambda expression support as seen here.
Related
It seems that a condition in BotFramework Composer only accepts pre-built functions and not templates.
If we have on common.lg a template like this:
# ValidID(text)
- ${length(text)==9 && isMatch(text, ‘[A-Za-z]{1}[0-9]{7}’)}
We can use in SendMessage like this for example:
- User’s Id: ${user.ID}, validation: ${ValidID(user.ID)}
But, why we are not permitted to use our custom function ‘ValidID’ inside the condition textbox of a Condition Branch/if for example?
Condition [${ValidID(user.ID)==true]
When we try to use in condition Composer says that ValidID is not a pre-built function or user scope variable...
This is a very frustrating limitation, because we have a lot of templates that we can call other templates in order to simplify complex validations and then, when we need to use this validations in a condition, we need to expand all templates to use only pre-built functions and templates loses its utility.
Someone knows anyway to work arround on this?
We tried to use a SetProperty box to assign our template to user scope variable, but it seems we have the same limitation.
We will appreciate any type of instructions or help to accomplish our expectations on this, thanks to all people that works everyday on BotFramework to make it better.
This is a bit of a strange question for Stack Overflow, since you're asking a "why" question that only the creators of the technology could answer rather than a "how to" question that any user of the technology could answer. If I had to guess I'd say this was an oversight, which would imply that you should raise this as a bug. On the other hand if you think this is intended behavior then you should raise this as a feature request.
I doubt there's a "workaround" beyond expanding the templates like you've said.
There are many LINQ implementations such as LINQ-to-Flickr. To make something like this, do I make my own custom LINQ provider?
Thanks
Have a look at this tutorial
Aha. That's the only way.
Hit in google 'write LINQ provider'. There are many tutorials out there.
Start with understanding what exactly Expression is, how it differs from lambdas and how to work with them.
I find this book quite helpful too (at least - beginning).
Yes, to get started, the best place is looking at the IQToolkit on Codeplex. You'll learn a lot about how it works.
If you do find you need to build your own then look at IQToolKit and the The Wayward Weblog for a full series on how to do it.
Come across an issue when doing a string compare as part of the where section of a linq expression against LINQ for NHibernate.
from x in NhibernateObject
where x.StringCol = "value"
select x
When it runs it retrns a runtime error about casting to an integer. I found a nice post about the issue and the solution at http://jason.pettys.name/archive/2009/09/28/nhibernate-with-linq-error-with-string-comparisons-in-vb.net.aspx
But my question is what is a "visitor" and what code would I write to achive the solution highlighted in the above post - missing the link here !!!
Visitor is a design pattern. You can find a description of it here http://www.dofactory.com/Patterns/PatternVisitor.aspx or here http://en.wikipedia.org/wiki/Visitor_pattern
If I correctly understand the article you linked to (haven't read it fully), then it is required to change NHibernate to work around this problem.
The definition of the visitor pattern is: "Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new
operation without changing the classes of the elements on which it operates."
The namespace of the visitor(s) you want to change is NHibernate.Linq.Visitors. You will probably have more difficulties using VB instead of C# with NHibernate.Linq, because VB3 does not support everything c#3 does. Those problems will be solved if you use .Net 4.0 (or c# of course)
Is there an application or utility that will convert LINQ to Lambda Expressions? (or an add-on to LINQPad)
The other day, I was surprised to find that ReSharper does this, at least for C# (not sure about VB, if that's what you need).
In LINQPad, you can click on the "lambda" button to get the lamdba version.
Edit:
As RBarry says, its the upside down "y", between "Results" and "SQL". This shows up in the results page after you execute a query.
How easy would it be to write a dumb LINQ provider that can just use my class definitions (which don't have any object references as properties) and give me the translated SQL. It can assume the name of the properties and the columns to be same as well as the names of the classes and the underlying tables. Can you please give me some pointers.?
It took me about 4 months of fulltime work (8 hours a day) to build a stable, working provider that implements the entire spec of linq. I would say I had a very simple, buggy and unstable version after about three weeks, so if you're just looking for something rough I would say you're probably looking at anything from a week up to two months depending on how good you are and what types of requiements you have.
I must point you to the Wayward blog for this, Matt has written a really good walkthrough on how to implement a linq provider, and even if you're probably not going to be able to copy and paste, it will help you to get to grips with how to think when working. You can find Matt´s walkthrough here: http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx . I recommend you go about it the same way Matt does, and extend the expression tree visitor Matt includes in the second part of his tutorial.
Also, when I began working with this, I had so much help from the expression tree visualizer, it really made parsing a whole lot easier once you could see how linq parsed to queries.
Building a provider is really a lot of fun, even if a bit frustrating at times. I wish you all the best of luck!
Give a look to the LINQExtender project, is a toolkit for creating custom LINQ providers.
Another option for giving you a leg up seems to be re-linq which is a framework for creating custom LINQ providers.
Here's the Source code and a nice overview (pdf) of what's involved in writing one.
I’ve written a tutorial series on my blog base on my experience developing a LINQ-to-SQL provider from scratch, starting with the expression tree composition stage (calling the LINQ methods), continuing with the expression visitor, breaking down of the query into components, parsing the where clause, generating the text and parameter and, eventually, compiling the whole thing into IL using the .NET expression namespace.
I’ve seen many incomplete posts that promised to explain how to write a provider, falling very short of the mark, barely scratching the surface and not actually delivering anything remotely executable.
The blog series I’ve written based on my experience has a sample project available for download with the simple provider that covers only the functionality required by the tutorial example. However, it also includes the production version supporting a number of operations (where, join, first, count, top, etc.), subqueries, nested statements, and etc. Additionally, it produces a cleaner SQL than a lot of what I’ve seen from Entities and LINQ-to-SQL. There’s no unnecessary/redundant nesting, wrapping everything in brackets and etc.
For anyone with a good level of abstract thinking, developing such a provider isn’t such a difficult task many set it out to be. I’ve developed one that’s used in production environment in about 3 months of part time work (meaning some evenings and weekends). From the get go it was aimed with performance and tidy SQL in mind – a goal it achieved.
It was a little hard to find the time to publish this material, but I thought – if it may help someone out there, there’s no reason for this experience to go to waste:
How to write a LINQ to SQL provider in C# Part 1 - Introduction
How to write a LINQ to SQL provider in C# Part 2 - Expression Visitor
How to write a LINQ to SQL provider in C# Part 3 - Where Clause Visitor
How to write a LINQ to SQL provider in C# Part 4 - Compiling Expression Trees
I have created a project 'LinqToAnything' which is designed to make it very very easy to implement a (simple) Linq provider.