Entity Framework 4.1 strongly-typed Include doesn't provide IntelliSense? - entity-framework-4.1

I've added: using System.Data.Entity;
and now I don't get an error on compilation of this:
var k = db.Countries.Include(e => e.Cities);
but I still have to manually go into the database schema and check the current table correct name and copy-paste/type it in the code.
There is no IntelliSense after I use the period:
var k = db.Countries.Include(e => e.
So, the purpose of all this is questionable since it doesn't really help at all. Typing manually the table name (entity set name) in quotation marks isn't any different than typing it in a lambda expression - except for it is shorter as a string.
Hints?

Seems like your problem will be resolved when you add
using System.Data.Entity;
to top of your page

Seems like the problem is in ReSharper 6 IntelliSense. After turning off ReSharper 6 IntelliSense, the original VS2010 IntelliSense works fine. The bug has been reported.

Related

Visual Studio sorting JSON properties wrong

I've run into a weird problem with Visual Studio 2017 (Enterprise, version 15.5.2) that I can only replicate on one specific machine. The problem doesn't occur on other development machines.
Given a file foo.resources.json with the following contents:
{
"FooReparatur": "Reparatur",
"FooVerlust": "Verlust",
"FooWema": "Wema"
}
Applying the quick action Sort Properties results in the keys being in the wrong order:
{
"FooReparatur": "Reparatur",
"FooWema": "Wema",
"FooVerlust": "Verlust"
}
The configured language for Visual Studio is English, there is no schema selected for the given file. The configured language for Windows is Estonian, but the sorting order is wrong by that alphabet as well.
I checked for any funny unicode characters or anything similar via a hexdump, but found nothing of the like either. As mentioned before, the file sorts correctly on all other machines.
I've tried disabling all the (default) extensions the installation has, but that doesn't resolve the problem either.
I've looked through most of the settings for both general text editing and the specific file type, but I can't find a setting that could cause this. What could be the issue? How can I debug this further?
This is a property of Estonian collation where 'V' and 'W' are treated as the same character. Hence, the next character that differs will be the significant one. As can be demonstrated by this C# code using .Net.
var words1 = new[] { "FooR", "FooVer", "FooWem" };
var words2 = new[] { "FooR", "FooVa", "FooWb" };
var estonianCultureInfo = new System.Globalization.CultureInfo("et-EE");
var estonianComparer = StringComparer.Create(estonianCultureInfo, false);
var sortedWords = words1.OrderBy(x => x, estonianComparer);
foreach (var word in sortedWords)
{
Console.WriteLine(word);
}
Console.WriteLine("[-----]");
sortedWords = words2.OrderBy(x => x, estonianComparer);
foreach (var word in sortedWords)
{
Console.WriteLine(word);
}
Output:
FooR
FooWem
FooVer
[-----]
FooR
FooVa
FooWb
Try to use this plugin to sort :
https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json
If dosn't work, try to install again the visual studio and choose language English to test if it work
Good Chance.

How to set decimal mark character or localization in CSVeed?

new Problem: my employer wishes me to implement CSVeed utility for a project. It works just fine except that data formatting is not recognised correctly. The data to read is formatted with semicolon (;) as field separator and colon (,) as decimal mark. The information on the projects home page is telling me that decimal conversion is done automatically, but e.g. a string 0,5 in csv file is interpeted as 5, a string 9,5 read as 95. In the source code of the project i find Information: "Makes sure that a specific Locale is used to convert numbers.". I am not exactly sure where to tell the csveed lib which l10n to use. At another point of source doc it says utility will use l10n of framework. Is this from Eclipse RCP which i am using oder from the machine ? Sorry for not posting any code, but i didnt find barely a hint where to setup
the decimal mark in the utility...
Anyone an idea ?
Greetings :)
My Goodness, why this verbose ? ^^
CsvClient<BeanClass> reader = new CsvClientImpl<BeanClass>(reader, BeanClass.class);
reader.setConverter("[name of property]", new CustomNumberConverter(Double.class, NumberFormat.getNumberInstance(Locale.[whereever]), false));
[name of property] has to be the name of the actual instance variable.
Greetings :)

How do you check a GUID against a list of known GUIDs in an SSRS expression?

I was writing an expression in SSRS/Visual Studio 2008, trying to compare a GUID to a list of known GUIDs... however, I was running up against errors in Visual Studio when I attempted that. Here is my code:
IIf(Fields!Id.Value = "E1A5AA02-6B0F-4D0D-87B6-E88773314B73" ...
It took a little digging, and eventually led me to this question to find the answer, but I used a combination of string conversion and casing to yield the result:
IIf(UCase(CType(Fields!Id.Value, GUID).ToString) = "E1A5AA02-6B0F-4D0D-87B6-E88773314B73" ...
For completeness, I probably should have wrapped UCase around both sides of the equation, just in case.

MSACCESS Function Name Error (Spanish/English)

This looks more like a configuration problem than a coding problem, but I just can't seem to find the source or solution.
I develop in an English enviroment, while working in my Reports the functions have English names, aka "Right", "Left", "Date". But it looks like when I deploy on some of the clients computers the language the client-pc understands is "Spanish", so it want's the functions names to be "Derecha", "Izquierda", "Fecha". And as such, fails to understand the functions I wrote.
Curious thing is, on the VBA code, this doesn't matter, it's only when I use the functions as a value on a property like "ControlSource". Eg.: Format(DocNum, "0000") Will work perfectly on my dev-pc, but return #Name? on the client's
Any ideas as to how to solve this (besides asking them to re-install)
If VBA modules you created in English work fine on the client machine try creating functions that recreate the left, right, date etc functions like this:
Public Function AltLeft(str As String, l As Long)
AltLeft = Left(str, l)
End Function
and use the alternate functions in your properties.

Turn a partial into a json variable in the controller

Hi I need to turn the html of a partial into a json object (NOT TO BE RENDERED), but to be stored in a seperate format.
Something like this:
#json = (:partial => "/answers/likers" ,:type => :html)
Although the above obviously does not work, but hope you get the point, thanks!
Try render_to_string. It takes the same arguments as render, and just returns a string instead of outputting the data.
It looks like it's being deprecated but I can't find any new method that provides that same functionality for Rails 3. I tested it on a local Rails 3 setup, though, and it works for me. If anyone knows the "new" way to do this in Rails 3 please let me know, I'm interested now :)
Rails has a .to_json function. However, I never used this together with a partial ...