Good to Know: Windows Azure and Web Services functionality


Here is my knowledge source listing for Windows Azure and Web Services functionality. Hope it helps someone:

Accessing Data
.NET Framework Data Providers
ADO.NET Entity Data Model Designer
ADO.NET Entity Data Model Designer
ADO.NET Entity Data Model Tools
Advanced using OData in .NET: WCF Data Services
ASP.NET Application State Overview
ASP.NET Session State Overview
CacheDependency Class
CacheItemPolicy Class
CacheItemPriority Enumeration
ChangeMonitor Class
Code First to an Existing Database
CommandType Enumeration
Configuring Parameters and Parameter Data Types
Create Database Wizard (Master Data Services Configuration Manager)
DataAdapter Class
DataAdapter.AcceptChangesDuringFill Property
DataContractAttribute Class
DataSet Class
DataSet Class
DataTable Class
DbContext Class
DBContext vs ObjectContexts
DbContext.SaveChanges Method
DbContext.Set<TEntity> Method
DbDataAdapter.Fill Method (DataSet)
DbDataAdapter.Update Method (DataSet)
Demystifying Entity Framework Strategies: Loading Related Data (Eager Loading,  Lazy Loading, Explicitly Loading)
EdmEntityTypeAttribute Class
EF Designer TPT Inheritance
Entity Data Model Wizard
Entity Framework
Entity Framework – Database First
Entity Framework (EF) Documentation
Entity Framework 5: Controlling automatic query compilation
Entity Framework- Code First to a New Database
EntityCommand Class
EntityConnection Class
EntityObject Class
EntityTransaction Class
How to: Use Lazy Loading to Load Related Objects
HttpContext.Cache Property
Improve Performance with Entity Framework 5
IsolationLevel Enumeration
LINQ (Language-Integrated Query)
LINQ to Entities: Basic Concepts and Features
LINQ to Objects
LINQ to XML [from BPUEDev11]
LINQ to XML Overview
Loading Related Entities (Eager Loading,  Lazy Loading, Explicitly Loading)
Model-First in the Entity Framework 4
ObjectCache Class
ObjectContext Class
ObjectContext management
ObjectQuery Class
ObjectQuery.ToTraceString Method
ObjectQuery<T> Class
Object-relational impedance mismatch
OData protocol
Open Data Protocol by Example
Plain Old CLR Object(POCO)
Precompiling LINQ Queries
Queries in LINQ to Entities
Relational database management system
Retrieving Data Using a DataReader
SerializableAttribute Class
SQL Server Connection Pooling (ADO.NET)
SqlCommand Class
SqlCommand.CommandText Property
SqlCommand.ExecuteReader Method
SqlCommand.ExecuteScalar Method
SqlConnection Class
SqlConnectionStringBuilder Class
SqlDataAdapter Class
SqlDataReader Class
SqlDataReader.Read Method
SqlParameter Class
SqlTransaction Class
System.Data.EntityClient Namespace
System.Data.SqlClient Namespace
System.Transactions Namespace
System.Xml Namespaces
Table-per-Type vs Table-per-Hierarchy Inheritance
The ADO.NET Entity Framework Overview
TransactionScope Class
Understanding ASP.NET View State
Understanding Service-Oriented Architecture
Update Model Wizard (Entity Data Model Tools)
Using the DbContext API
Using the REST Interface
Walkthrough: Mapping Table-per-Hierarchy Inheritance in Dynamic Data
WCF Data Services 4.5
WCF Data Services Overview
Working with Datasets in Visual Studio
Working with POCO Entities
XElement Class
XML Documents and Data
XmlDocument Class
XmlReader Class
XmlWriter Class
XPath Examples
Designing and implementing WCF Services – Create, Configure, Secure, Consume
Accessing Services Using a WCF Client
Azure Service Bus
Basic [WCF Samples]
BasicHttpBinding Class
BinaryMessageEncodingBindingElement Class
Binding [WCF Samples]
Chapter 7: Message and Transport Security
Choosing a Message Exchange Pattern
CompositeDuplexBindingElement Class
Configuration Editor Tool (SvcConfigEditor.exe)
Configuring Services Using Configuration Files
Creating the Web Service Proxy
Custom Binding Samples
Custom Bindings
Data Contract Known Types
DataContractAttribute Class
DataMemberAttribute Class
Difference between BasicHttpBinding and WsHttpBinding
Endpoints: Addresses, Bindings, and Contracts
EnumMemberAttribute Class
Extending Dispatchers
Extensibility [WCF Samples]
Fault Contract
Fault Contract – Handling Errors in WCF and A Very Simple WCF Service Implementation
Getting Started Tutorial
Host WCF in an Azure worker role (CSAzureWCFWorkerRole)
Hosting WCF Services
How to: Create a Transactional Service
How to: Create a Windows Communication Foundation Client
How to: Expose a Metadata Endpoint
How to: Implement a Windows Communication Foundation Service Contract
How to: Inspect or Modify Messages on the Client
How to: Set the Security Mode
How to: Use the ChannelFactory
IClientMessageInspector Interface
IDispatchMessageInspector Interface
KnownTypeAttribute Class
Message Inspectors
Message Patterns in WCF Services
Message Security in WCF
MetadataExchangeBindings Class
MtomMessageEncodingBindingElement Class
NetMsmqBinding Class
NetNamedPipeBinding Class
OneWayBindingElement Class
OperationBehaviorAttribute Class
OperationContractAttribute Class
Programming WCF Security
Publishing Metadata
Reliable Sessions Overview
ReliableSessionBindingElement Class
Scenario [WCF Samples]
Securing and Authenticating a Service Bus Connection
SecurityBindingElement Class
Service Bus Bindings
Service Bus Queues, Topics, and Subscriptions
ServiceBehaviorAttribute Class
ServiceContractAttribute Class
ServiceHost Class
ServiceModel Metadata Utility Tool (Svcutil.exe)
Sessions, Instancing, and Concurrency
Simplified Configuration
Simplified Configuration for WCF Services
SslStreamSecurityBindingElement Class
Status codes
System-Provided Bindings
TextMessageEncodingBindingElement Class
TransactionFlowBindingElement Class
Transactions in WCF Services
Types Supported by the Data Contract Serializer
Using Data Contracts
WCF Configuration Tools
WCF Extensibility – IParameterInspector
WCF Extensibility: Parameter Inspectors
Versioning Strategies
Windows Communication Foundation Endpoints
Windows Communication Foundation Tools
WindowsStreamSecurityBindingElement Class
WSHttpBinding Class
Creating and consuming Web API-based services – Design, Implement, Secure, Host and Manage, Consume
A WebAPI Basic Authentication Authorization Filter
AcceptVerbsAttribute Class
ActionFilterAttribute Class
Add Models and Controllers
Async Streaming in ASP.NET Web API
Asynchronous Programming with Async and Await (C# and Visual Basic)
Authentication and Authorization in ASP.NET Web API
Basic Authentication in ASP.NET Web API
Content Negotiation in ASP.NET Web API
Cross-Site Request Forgery (CSRF)
Dependency Injection in ASP.NET Web API 2
Enabling Cross-Origin Requests in ASP.NET Web API 2
Enabling CRUD Operations in ASP.NET Web API 1
Forms Authentication in ASP.NET Web API
Getting Started with ASP.NET Web API 2 (C#)
How to host your web API.
HTTP Authentication: Basic and Digest Access Authentication
HttpClient Class
HttpClient.GetAsync Method (String)
HttpMessageHandler Class
HttpResponseException Class
HttpResponseMessage Class
Integrated Windows Authentication
JSON and XML Serialization in ASP.NET Web API
Makecert.exe (Certificate Creation Tool)
Media Formatters in ASP.NET Web API 2
Media Formatters in ASP.NET Web API 2
Parameter Binding in ASP.NET Web API
Preventing Cross-Site Request Forgery (CSRF) Attacks in ASP.NET Web API
Preventing CSRF Hacks in ASP.NET WebAPI
Routing Service
Routing Services [WCF Samples]
synchronous Streaming in ASP.NET WebApi
Using Asynchronous Methods in ASP.NET MVC 4
Working with SSL in Web API
Deploying web applications and services
Azure Guest OS Releases and SDK Compatibility Matrix
Azure Service Definition Schema (.csdef File)
Configuring a Web Server for Web Deploy Publishing (Remote Agent)
Configuring Parameters for Web Package Deployment
Configuring Step 1: Install IIS and ASP.NET Modules
Continuous Delivery for Cloud Services in Azure
Continuous delivery to Azure using Visual Studio Online
Export a Package through IIS Manager
Get Started with Azure Cmdlets
Get started with Azure Websites and ASP.NET
How to Configure Cloud Services
How to Deploy an Azure Website
IIS Information
Installing and Configuring Web Deploy on IIS 7
Installing NuGet
Manage Deployments in Azure
NetworkConfiguration Schema
Nuspec Reference
Package Manager Console Powershell Reference
Reference for the Web Application Package
Shadow Copying Assemblies
Step 1: Examining the Configuration Files
Swap Deployment
Team Build + Web Deployment + Web Deploy + VS 2010 = Goodness
Web Deploy Command Line Syntax
Web Deployment Overview for Visual Studio and ASP.NET
Web.config Transformation Syntax for Web Project Deployment Using Visual Studio

Did You Know!?: SharePoint Webparts and libraries

Hello again!

I decided to start a new blogging category named “Did You Know!?”. The idea behind this is that I write tips and tricks you might not think of or may not have heard but will help you and make you life easier.


Content Query WebPart – Audience targeting

Custom views for document library or lists webparts

So here we go:

Content Query WebPart – Audience targeting:

If you did not know you can filter content of the CQWP(and also in the code if you are using CrossListQueryInfo and CrossListQueryCache) by enabling Audience Targeting to the webpart.

What do you need to do to make it to work:

– Enable the CQWP Audience targeting – from the webpart properties

cqwp audience

– Enable your content source to support audience targeting – Example: your library or list – from the list/library settings

Go to your library settings => Under “General Settings” => Select “Audience Targeting Settings” => Then enable Audience targeting by checking the checkbox.

After this you will get a new field to your list named as “Target Audiences”. Now when you create or edit items you will be able to chose an audience to that item. When a CQWP has audience targeting enabled what will happen is that the webpart will check the item audience targeting values and compare them to the user profile audiences. If the user is part of the items audience then the item will show up in the CQWP

– Configure your user profile service to support audience targeting

This is the tricky part. You need to configure a whole lot of places to get your audience targeting for a user to work so that webpart and other content related queries etc filter data properly.

I will do it in three parts the configuration:

1. Configure a Term Set in your Manage Metadata Service. Let’s say named “Location” that has 10 different countries your organization is interested in. This I will not explain in much detail. I hope you are familiar with MMS.

article mms

2. Go to your user profile service and create a new User Property(The picture below as an example). Also take notice(I do not remember exactly) but the privacy settings needs to set to everyone for this field to work properly.

new user property

3. Next assign to a user profile(s) a desired location to the newly created field.

4. Then lets create a new audience. In your user profile service go to “Manage Audiences”. Then Press the “New Audience” button. In the next view give the audience a name and an owner. And remember to select the rule strategy. I chose “Satisfy any of the rules so that I may include many rules to a single audience. This way I can aggregate two or more location to an audience and have any of them apply to an item and user.

5. In the next step select as an “Operand” property and select the location property we created and as the operator I would chose “Contains”. Next in the Value field select a value.


6. Now all you have to do is compile the audience. Press “Compile Audience”. After the compilation is complete you should see how many members are apart of this audience. Next when you assign this audience to an item any user from is apart of this audience through his location value that corresponds to the audience location values are going to see the CQWP item.

Custom views for document library or lists webparts:

You are able to create custom Views for your library or list webparts that show you content from your library. You are not limited to what you get once you add a documents library to a page as a webpart. BUT there is a catch!!! If you do select and existing view and use it to display content in a certain manner in a page YOU WILL NOT have a reference to that view in you library BUT A COPY held in the webpart. So lets say that you have a view that lists the TOP 5 newest documents in your library. You decided to add the document library webpart to a page, you then select this TOP 5 view, what happens is that you will get a copy that is not related to the original view of that document library. SO if you make changes to the view in the document library view those changes will not be seen in your webpart because it is not a reference. So remember this when you use a view from a library or list into your webpart.

Resources for SharePoint Search Results Customization

Recently I had to modify a clients search results page to show the search results as a table and not as a list. After a long battle I found a few sources which I would like to share with other people. They might come in handy.


First link:

This is a great link from which I got alot of help. With this XSL file you can show your search results as a table.

Second link:

When you are working with search result you need sometimes to get a hold of the actual search results in XML format that is used by the xsl to be displayed to your page users. The following XSL piece of code copied and pasted in the search results webpart is going to show you the result in XML.

<xsl:stylesheet version=”1.0″
<xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/>
<xsl:template match=”/”>
  <xmp><xsl:copy-of select=”*”/></xmp>

I recommend the following link for more info:

It is a bit old 🙂 BUT still the information applies.

Lastly I want to share a solution I had to conjure up for the XSL file. My client wanted to have a link to a search document so that when you press that link it does not open you the document BUT it opens the document metadata properties in view mode. This was simple enough, just make an URL that points to the documents location, add the item ID to the view page of that library to show you the documents properties. One of the problems it that out of the box the ID field of the XSL is not the ID of the document in its library BUT the ID of the search result. Meaning that if you get 14 search results the ID is the position of the search result in the order it is in the retrieved through the search.

So to get it to work I had to create a new search “Metadata property” named ListItemID. This property uses the crawled property named “ows_ID” to get the documents REAL ID in the library it is located. Then I simply used this new search metadata property in my XSL and everything worked like a charm.

ANYWAY 🙂 below if the piece of XSL and HTML to display a link that allows a user to access the document properties in view mode. Alter it to get your desired functionality.

<a href=”{sitename}/Forms/DispForm.aspx?ID={number(ListItemID)}”>

I’ll explain a bit the above piece of code. The {sitename} will retrieve the list location where this item is located. The DispForm.aspx is a page that can be used to view documents. {number(ListItemID)} is simply a function that converts the ListItemID metadata property value into a number. You have to provide the document ID value to the aspx page. This way the ASPX page will retrieve the proper document information.

New icon to CQWP – Content Query Webpart


So you may have wondered HOW to enable or add a new icon to a CQWP. Well aparently you can not do it through the user interface and you need to do some XSLT modifications. Here is what you need to do:

1. You need to download the following MS XSL file to datetime processing and add it into your XSLT file that displays your data:

The MS BLOG file

The XSL piece of code to add your XSL file, this will include the above downloaded file into your XSL file:

<xsl:import href=”/Style Library/XSL Style Sheets/date_templates.xsl”/>

2. Inside your XSL file that displays data(in the case of a CQWP lets say the item style XSL template) add the following lines:

<xsl:call-template name=”getDayDelta”>
<xsl:with-param name=”paramDateA” select=”@ArticleDate”/>
<xsl:with-param name=”paramDateB” select=”ddwrt:Today()”/>

<xsl:variable name=”article_date”>
<xsl:value-of select=”ddwrt:FormatDate(string(@ArticleStartDate), 1033,1 )”/>
<xsl:variable name=”today”>
<xsl:value-of select=”ddwrt:FormatDate(string(ddwrt:Today()), 1033, 1)”/>
<xsl:variable name=”date_diff”>
<xsl:call-template name=”getDayDelta”>
<xsl:with-param name=”paramDateB” select=”ddwrt:FormatDateTime(string(@PublishedDate),1033, ‘yyyy-MM-dd’)”/>
<xsl:with-param name=”paramDateA” select=”ddwrt:FormatDateTime(string(ddwrt:Today()),1033, ‘yyyy-MM-dd’)”/>

The above was meant for a CQWP that would lift the latest blogs inside a blog site. Notice the @PublishedDate parameter. This can be @ArticleDate or @ArticleStartDate etc. What you need to make the date difference calculations.

The date_diff XSL variable will hold the date time calculation between the blog post published date and the present date. Then you can use this value to determine when to show the New icon.

3. Add the logic to display the New icon. The below logic tells that if the items is less than 7 days old you need to display the New icon.

<xsl:if test=”$date_diff &lt; 7″>
<img src=”/_layouts/1033/images/new.gif” alt=”New!” />

Sample in the XSL Blog title:

<div class=”blogListPostBlock”>
<!– Title –>
<a style=”color: #295AC6;”>
<xsl:attribute name=”href”>
<xsl:value-of select=”$SafeLinkUrl”/>
<xsl:value-of select=”$DisplayTitle” />
<xsl:if test=”$date_diff &lt; 7″>
<img src=”/_layouts/1033/images/new.gif” alt=”Smiley face” />

Also please take into consideration that this is for the LCID language ID 1033 English  You need to make sure it fits your language if you wish to use a different language translation for New icon.