Archive
April 11th 2012 Links: VB6, .NET Portable Class Libraries, Internet Explorer 10, ASP.NET MVC 4, eBooks
Following the steps of Scott Guthrie’s link-listing series, here’s our new batch of links in our own series:
Windows
Good news for those still using VB 6: it’ll be supported on Windows 8!
It’s the end of mainstream support for Windows Vista
April 10, 2012: That’s the date Windows Vista support moves from mainstream to extended (meaning paid for everything but security updates).
Visual Studio
Hidden Gems in Visual Studio 11 Beta – .NET Portable Class Libraries
Scott Hanselman details Portable Class Libraries which is a feature available in Visual Studio 2010 (through an extension) and in Visual Studio 11.
TFS 11 Power Tools Beta Available
Good news TFS 11 power tools (beta) are now publicly available
Dev
Yay! All sources are on CodePlex! if you haven’t already, go check them out because that’s some good looking .NET code ![]()
The Danger of the Large Object Heap (LOH)
Another article which we like on the same subject is: “Large Object Heap Uncovered” (written by Maoni Stephens).
We actually wrote an article ourselves which is quite related to the subject as well: Manipulating SQL Blobs With Streams.
IndexedDB Updates for IE10 and Metro style apps
“IndexedDB is a W3C Working Draft that enables you to store, search, and retrieve data on the user’s device, even when Internet connectivity is disabled. IndexedDB is a feature of the Web platform shared by IE10 and Metro style apps in the Windows 8 Consumer Preview.”
Hmm, very interesting…
eBooks
Grab a free copy of “Under the hood of .NET Memory Management”
We did it, it was worthy, so we thought we’d share ![]()
Free ebook: Introducing Microsoft SQL Server 2012
With SQL Server 2012 now available, I’m sure it’ll come in handy.
Cheers,
Carl Anderson
CodeFluent Entities: Attributes
Using CodeFluent Entities you can define attributes on other concepts such as Entities, Methods or Properties and what gets really interesting is that the .NET Business Object Model Producer translates those CodeFluent Entities Attributes into actual .NET attributes ![]()
Now say you want to specify some specific attributes on your generated .NET classes or data annotations on your properties, defining attributes in your model would be the way to go!
To do so select your concept such as a property and click on “Add Attribute” in the ribbon, the following dialog will show up:
In the attribute name set the full type name of your attribute such as “System.ComponentModel.DataAnnotations.RequiredAttribute”.
Note: Setting the attribute class using the drop down list in the lower part of the form allows you to specify where this attribute should be placed in the generated classes. Default is in the entity class, but you can also place it in the service class, the service interface, or the proxy class.
In the screenshot below we defined a Required data annotation attribute on the Name property of our entity:
Then here’s the output after generating our model over:
[System.ComponentModel.DataAnnotations.RequiredAttribute()]
[System.ComponentModel.DefaultValueAttribute(default(string))]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Type=typeof(string))]
public string Name
{
(…)
To specify a parameter to your attribute, go back to your model, select your attribute and click on the Arguments property in the property grid:
And let’s add an error message to our required attribute:
Generate over and here’s the result:
[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessage="Name is required")]
[System.ComponentModel.DefaultValueAttribute(default(string))]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Type=typeof(string))]
public string Name
{
(…)
Carl Anderson