Microsoft Exam 70-487 Study Notes

This post is related to the previous post I had that covers exam 70-487.  However, the content on this post is much more thorough and provides examples for the topics that you will be tested on.  In no way can I take credit for this post, however.  I co-worker of mine, Danny Turco, has been following my blog series for the tests.  He was studying for 70-487 and found that (he didn’t actually say this; I did) the post was incomplete.  He has provided me with the notes he used to study for the test, and said it would be cool if I post them here.  This is a really awesome set of study material.  Make sure to send Danny a shoutout in the comments below or share this article using the social network links below.

 

WCF


More Info:

  1. http://msdn.microsoft.com/en-us/library/ms731734.aspx

   

Protocol Mapping:

  1. Represents a configuration section for defining a set of default protocol mapping between transport protocol schemes (e.g., http, net.tcp, net.pipe, etc.) and WCF bindings.

    <protocolMapping>
    	<add scheme="http" binding="basicHttpBinding"/>
    	<add scheme="net.tcp" binding="netTcpBinding"/>
    	<add scheme="net.pipe" binding="netNamedPipeBinding"/>
    	<add scheme="net.msmq" binding="netMsmqBinding"/>
    </protocolMapping>

   

Channel Factory and the client:

  1. If you are not using the proxy generated from svcutil then when using the channel factoy you must cast that channel object to a IClientChannel  to close and abort

   

Configuration Entries:

<serviceBehaviors>
	<behavior name="ServiceBehavior">
		<serviceMetadata httpGetEnabled="true"/><!--: enables getting metadata and a wsdl link-->
		<serviceDebug includeExceptionDetailInFaults="true"/><!--: allows for exception information to be returned to the client.-->
	</behavior>
</serviceBehaviors>
<endpointBehaviors>
	<behavior>
		<webHttp/><!--: when used in conjunction with the <webHttpBinding> standard binding, enables the Web programming model for a Windows Communication Foundation (WCF) service.-->
		<enableWebScript /><!--: makes it possible to consume the service from ASP.NET AJAX web pages.-->
	</behavior>
</endpointBehaviors>

   

Diagnostics:

<system.serviceModel>
	<diagnostics>
	<messageLogging logEntireMessage="true" logMalformedMessages="true"
		logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
	</diagnostics>
</system.serviceModel>

   

From Code:

//endpointBehaviors
foreach (var sep in serviceHost.Description.Endpoints)
{
	sep.Behaviors.Add(new MyBehavior());
}

      

Restful Host setup manual:

  1. Endpoint binding = “webHttpBinding”
  2. Endpoint behavior contains <webHttp/>
  3. Operations use the WebGet/WebInvoke attributes with UriTemplates defined.

   

 Restful Host setup builtin:

  1. Use System.ServiceModel.Web.WebServiceHost
  2. In config ONLY MUST specify the baseAddress for the auto-wiring to happen

   

 Restful website setup:

  1. In svc file reference the ServiceLibrary Project
  2. Factory=”System.ServiceModel.Activation.WebServiceHostFactory
  3. Don’t need anything in the websites web.config

   

 Restful website setup on client (non browser):

  1. Need Service contract to have WebGet/WebInvoke
  2. Add reference directly to the ServiceLibrary Project
  3. Add System.ServiceModel.Web.WebChannelFactory<T> in client code and tell it the URI of the service address (can read that in from config)
  4. Create client object from channel factory, and no other things need to change in client in regards to calling operations from the service

   

WebOperationContext:

  1. Access by calling WebOperationContext.Current
  2. Gives you entry into the incoming/outgoing request/response context
  3. Access to most common HTTP details

   

Ajax WCF Service:

  1. Enable the WebScriptingEnablingBehavior (enables this for each operation contract) you can not mix this with UriTemplates
    1. This is added to the endpointBehaviors as <enableWebScript/>
  2. Service must be configured with the WebHttpBinding
  3. You dont need to use the WebGet/WebInvoke
  4. Produces a JS proxy via the baseAddress/js
  5. To simplify setting this up use the WebScriptServiceHostFactory in your svc file in your website project
  6. Response format for the service contract must be JSON
  7. Must add a script manager to page and add a service reference to the svc you created above, this is what generates the /js javascript proxy

   

Self Hosting:

  1. Create the serviceHost<T>(baseAddress)
    1. make sure you pass in the base address for the service here
  2. If need special bindings and behaviors use the app.config or set them up here before open is called
    1. host.AddServiceEndpoint(<t>,new binding())
    2. host.Description.Behaviors.Add(new Behavior())
  3. serviceHost open()
  4. console.readline to keep service running

   

Instance Context:

  1. PerSession
    1. A new InstanceContext object is created for each session.  This means a new instance of the service itself is created for every unique client connection. If the channel does not create a session this value behaves as if it were PerCall.
  2. PerCall
    1. A new InstanceContext object is created prior to and recycled subsequent to each call.   So a new instance of the service is created for every call even if the calls are coming from the same client.
  3. Single
    1. Only one InstanceContext object is used for all incoming calls and is not recycled subsequent to the calls. If a service object does not exist, one is created.
  4. The Default is PerSession

   

Transactions:

  1. TransactionFlow
    1. add this to service contract
    2. If the service was stateful
      1. Add SessionMode = Required  attribute to the service contract
  2. On each operation in the interface that should be apart of the transaction need to add
    1. [TransactionFlow(TransactionFlowOption.Mandatory)]
      1. Possible choices
        1. NotAllowed: The operation cannot participate in a transaction. This is the default value for this attribute.
        2. Allowed: The operation will participate in a transaction if the client creates one.
        3. Mandatory: In order to call this operation, the client must create a transaction.
  3. In the code that implements the service contract
    1. [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)]
      1. Setting the TransactionScopeRequired property to true specifies that clients cannot call these methods unless they are part of a transaction
      2. Setting the TransactionAutoComplete property to true specifies that the transaction will complete automatically if no exceptions occur. This is the default value for this property.
    2. [ServiceBehavior(  TransactionIsolationLevel=    System.Transactions.IsolationLevel.Serializable,  TransactionTimeout=”00:00:30″)]
  4. In the bindings add
    1. <wsHttpBinding> <binding name=”wsHttpBinding”  transactionFlow=”true” /> </wsHttpBinding>
    2. Add this binding to your endpoint
  5. In the client enable transactions in the binding
    1. transactionFlow=”true”
  6. TransactionScope
    1. Use this to execute client service calls
  7. This is set up with a ServiceBehavior on the service class

   

Accessing Claims:

  1. ClaimsPrincipal.Current
    1. New way of access the IIdentity in WCF 4.5
    2. Recommended way
    3. Always get populated

   

Security in the Bindings:

  1. Note the locations of the mode and clientCredentialType

    <wsHttpBinding>
    	<binding name="wsHttpEndpointBinding">
    		<security mode="Transport">
    			<transport clientCredentialType="Ntlm" />
    		</security>
    	</binding>
    </wsHttpBinding>

   

WCF Extensibility


More Info:

  1. http://msdn.microsoft.com/en-us/magazine/cc163302.aspx

   

Service Description:

  1. All that WCF needs to start the service
  2. Contains Endpoints
    1. Address
    2. Binding
    3. Contract
  3. Behavior Interfaces (SECO)
    1. All called during open or on first client request
    2. Service (interface IServiceBehavior contains)
      1. Can add these via Code, Configuration, Attributes
        1. Validate
        2. AddBindingParameters
        3. ApplyDispatchbehavior
      2. Via code: add the bevahior to the ServiceHost.Description.Behaviors.Add
      3. Via attribute: derive from the Attribute class, then just add the attribute to the ServiceClass
      4. MetaData is added to the service behaviors
        1. <serviceMetaData httpGetEnabled=”true”/>
    3. Endpoint (interface IEndpointInterface contains)
      1. Most used of the Interfaces
      2. Can add these via Code, Configuration, ONLY attributes if its a client callback implementation
        1. Validate
        2. AddBindingParameters
        3. ApplyDispatchbehavior
        4. ApplyClientBehavior
    4. Contract (interface IContractBehavior contains)
      1. Can add these via Code, Attributes 
    5. …………………………..
      1. …………………..
        1. Validate
        2. AddBindingParameters
        3. ApplyDispatchbehavior
        4. ApplyClientBehavior
    6. Operation (interface IOperationBehavior contains
      1. Can add these via Code, Attributes 
      2. Examples
        1. WebGet/WebInvoke
        2. XmlSerializer/DataContractSerializer
        3. Inspect and change operation parameters
      1. Interface Methods
        1. Validate
        2. AddBindingParameters
        3. ApplyDispatchbehavior
        4. ApplyClientBehavior
  4. Before “Open” these can all be changed and added to
  5. After “Open” is called on the service host
    1. Runtime is initialized
    2. Descriptions become immutable(unchangeable)
    3. All listeners are started

   

WCF Runtime:

  1. Message object
    1. Is single use, once the body is read it is no longer valid to send on
    2. So if you read the message must create a new one to pass on
  2. Message Inspectors
    1. Most used
    2. inspect, modify, replace incoming/outgoing messages
    3. Scenarios
      1. Logging
      2. Custom Authentication
      3. Tweaking of messages
      4. Correlation of messages
    4. On the serverside
      1. IDispatchMessageInspector
        1. AfterRecieveRequest
        2. BeforeSendReply
      2. These inspectors are normally added to the Endpoint Behaviors in the ApplyDispatchBehavior method as part of the endpointDispatcher.DispatchRuntime
    5. On client side
      1. IClientMessageInspector
        1. BeforeSendRequest
        2. AfterRecieveReply
      2. These inspectors are normally added to the Endpoint Behaviors in the ApplyClientBehavior method as part of the clientRuntime.MessageInspectors
    6. Contains a correlation object which is passed from the Request to the Reply
  3. Parameter Inspectors
    1. Inspect and modify operation messages at the parameter level
    2. Return value from operation can NOT be modified
    3. Scenarios
      1. Logging
      2. Parameter validation
    4. Server/Client side
      1. IParameterInspector
        1. BeforeCall
        2. AfterCall
    5. If it is only for a particular operation it is added in the OperationBevahior class
    6. If it applies to all operations in the contract they can be applied in the EndpointBehavior or ContractBehavior classes
    7. Contains a correlation object which is passed from the BeforeCall method to the AfterCall method so can match up Request/response if need be
  4. Message Formatters
    1. Only ever 1 per call(operation) per side (client/server)
    2. Convert between CLR object (.NET objects) and Channel.Message
      1. Performs the Serialize/Deserialize
    3. Server side
      1. IDispathMessageFormatter
        1. DeserializeRequest
        2. SerializeReply
      2. Bound to the operation and is added through the DispatchOperation of the EndpointBehaviors or OperationBehavior 
    4. Client side
      1. IClientMessageFormattter
        1. SerializeRequest
        2. DeserializeReply
      2. Bound to the operation and is added  through the ClientOperation of the  EndpointBehaviors or OperationBehavior 
    5. These do NOT provider a correlation object
  5. Operation Selector
    1. Decides which operation to be called
    2. Rarely ever used on the clientside
    3. Server side
      1. IDispatchOperationSelector
        1. SelectOperation
      2. Can be added in the DispatchRuntime (sometimes in the client callback dispatch runtime).
      3. When receiving a message from the Runtime Dispatch it fires after the Message Inspectors do
  6. Operation Invokers
    1. Makes the actual call to the service operation
    2. Scenarios
      1. Caching
      2. Bypass service operation code
      3. Handle dynamic operations
        1. Ex. Ping or heartbeat operation you can apply to all services without adding a contract operation directly for it
    3. Server side
      1. IOperationInvoker
        1. AllocateInputs
        2. IsSynchronous
        3. Invoke
        4. Begin/End Invoke
      2. Typically added in OperationBehaviors
      3. Can be added in the DispatchOperation
  7. Instance Provider
    1. Creates an instance of the service class
    2. Scenarios
      1. IoC: when service class does not have a default constructor and needs something from an IoC to create valid Service class object
      2. Caching
    3. Server side
      1. IInstanceProvider
        1. GetInstance
        2. ReleaseInstance
      2. Can be added in the DispatchRuntime
      3. Usually set via EndpointBehavior or ServiceBehavior
  8. Instance Context Provider
    1. Instance context represents the running instance of the service
    2. Instance context contains
      1. ServiceHost
      2. Channels of the service
      3. Extension of the service
    3. Used to share instances of the service type and the corresponding runtime across multiple calls (implementing sessions)
    4. Scenarios
      1. Sessions
    5. Server side
      1. IInstanceContextProvider
        1. GetExistingInstanceContext
        2. InitializeInstanceContext
    6. Usually a ServiceBehavior, applied as an attribute
    7. Can be added in the DispatchRuntime
    8. Takes a lot to implement not used very often.
  9. Error Handler
    1. Customize errors sent to client
    2. Scenarios
      1. operation bypass
      2. Custom errors
    3. Service side
      1. IErrorHandler
        1. HandleError
          1. Async called
        2. ProviderFault
    4. Can be added to the DispatchRuntime 
      1. in the endpointDispatcher.ChannelDispatcher.ErrorHandlers
      2. in the endpointDispatcher.DispatchRuntime.Operations.ParameterInspector
    5. Usually added as an EndpointBehavior

   

Windows Azure (windows.azure.com)


Execution Models:

  1. Virtual Machines:
    1. can create a VM frm Microsoft VHD gallery or from your own VHD (Virtual Hard Drive)
    2. known as IAAS(Infrastructure as a Service)
    3. Pay by the hour regardless of usage
    4. Stored as Azure Blobs
    5. This is the most general solution but needs management of VM
  2. Web Sites:
    1. Shared VM with IIS,
    2. Or you can have you own VM with IIS
    3. Three Types
      1. Static html websites
      2. Mainstream web applications like Drupal, WordPress
      3. Custom web applications like asp.net, php, node.js
  3. Cloud Services:
    1. known as PaaS (Platform as a Service). environment is created for you
    2. They are all about supporting applications.
    3. Has 2 roles
      1. Web Roles: run IIS, and handle user interactions
      2. Worker Roles: Commonly handle back end processing
    4. Should not store state in the VM, since vm is not persisted
    5. Uses
      1. Creating a new Saas (Software as a Service)
      2. Creating a new customer facing application or an employee facing application
    6. Low admin costs

   

Data Management:

  1. SQL Azure Database: Relation database part of PaaS.
    1. Limited to 100gb of data
    2. Can use SQL Federation to join multiple SQL Azure databases and query against them as one. Uses a concept of “Shards”
    3. SQL Data Sync
      1. Syncs data between multiple SQL Azure databases across multiple data centers or to local On-Premise SQL Servers
      2. All is setup with configuration only
  2. Table Storage:
    1. When you don’t need full blown SQL.
    2. It is simply a Key/Value store
    3. These tables contain partitions and row keys. When an application needs to request data they simply supply the partition key and row key to get the data entity back
    4. Can contain upto 100TB of data, and is way cheaper then using SQL database
    5. An entity can be a max of 1MB and can only have a max of 255 properties including the required 3
      1. Partition Key
      2. Row Key
      3. Timestamp
    6. Url format
      1. http://<storage account>.table.core.windows.net/<table>
    7. Components
      1. Azure Account
      2. Tables
        1. 1 to many
      3. Entity
        1. 1 to many per table
  3. Blob Storage:
    1. Stores large binary objects
    2. Stored in containers
    3. Single blob can be up to 200GB
    4. Blob container has a max size of 100TB
    5. Blob url format
      1. http://<storage account>.blob.core.windows.net/<container>/<blob>
    6. Components
      1. Azure Account
      2. Container
        1. 1 to many
      3. Blob
        1. 1 to many per container

   

Business Analytics:

  1. SQL Reporting: Creates reports from SQL Azure Database. Can also create reports from data that is on-site as well
  2. Hadoop:
    1. Open source big data analysis.
    2. Large unstructured non-relational data
    3. Example Uses
      1. Log files from server farms
      2. Info from RFID tags or sensors
      3. Click through data from websites

Networking:

  1. Virtual Network: Lets you set up VM’s in Azure that look like they are apart of your On-Premise Network. (VPN)
  2. Connect: Lets you connect an Azure application to a couple of On-Premise computers
  3. Traffic Manager: Routes user requests to your application to the correct data center that is running your cloud application. Handles load balancing and fail-overs

  

Messaging:

  1. Queues:
    1. Send messages between Web roles and worker roles
    2. Message size limit is 64kb
    3. 1Tb total capacity of a single queue
    4. Url format
      1. http://<storage account>.queue.core.windows.net/<queue>
    5. When accessing a queue in code the queue name MUST be lowercase
  2. Service Bus: connect applications together
    1. Queues similar to Queues above
    2. Topics: Pub/Sub
      1. Topic is just like a queue
      2. Subscribers pick up messages based on a filter
    3. Relays:
      1. direct connection to cloud and not have firewalls be an issue
      2. each application opens an outbound tcp connection to the relay. Connection is held open while communication occurs. This is what gives then a stable IP to communicate on, and the inbound message travels on the outbound tcp connection so the firewall lets it pass.

   

Caching:

  1. Caching:
    1. Distributed caching like memcache
    2. Uses a DataCacheFactory to find the cache you are interested in getting values from.
      1. Want one per appDomain
      2. Use singleton pattern when creating one
      3. It always get the default cache, which there is only one cause there is only 1 cache per namespace.
    3. To get things into cache and set an expiration in code use
      1. Put: Any two inserts expected to be the same. Last write for the cache key wins
        1. Use for reference data
        2. Slow changing data
        3. Returns a DataCacheItemVersion object. Can use this to implement optimistic versioning of cache across application instances. Pass this back into the next Put call to valiate you have the latest version to update
      2. PutAndUnlock:
        1. Used along with a DataCacheLockHandle and the cache.GetAndLock method once the value is read and locked, to change call PutAndUnlock to write new values and remove the DataCacheLockHandle
        2. If locking is going to be used EVERYONE must use or bad things can happen if mixed
      3. Unlock:
        1. can unlock a lock created with the DataCacheLockHandle without updating item
      4. GetAndLock:
        1. Gets an item from the cache and locks if from access. Uses a DataCacheLockHandle
      5. Add:
        1. Items are kept unique and an error (DataCacheException) is raised when a collision is detected. Check the SubStatus for the underlying error
        2. Uses
          1. for SessionState data
          2. Slowly changing data
          3. Activity Data
        3. Returns a DataCacheItemVersion object. Can use this to implement optimistic versioning of cache across application instances
  2. CDN: sets of blobs stored at numerous access points all over the world

   

Identity:

  1. Windows Azure Active Directory
    1. Run Win Server AD in Azure Virtuals: Makes sense when running apps in the cloud that need AD, example would be Sharepoint
    2. Run Win Azure AD (Active Directory):
      1. Makes sense when using cloud applications (Saas)
      2. Provides a single sign-on though an Access Control Service

      

ODATA


 Setting up WCF Data Service:

  1. In the service Class
    1. In the class file DataService<t> must reference a class that has Iqueryable properties in it.
    2. In that same class in the InitializeService methods we must set up Entity access rules
      1. config.SetEntitySetAccessRule(“<entityName>”, EntitySetRights.AllRead);
    3. Define filters and interceptions
    4. If in the entity there is not a property named ID you will need to place the DataServiceKey(“<propAsKey>”) attribute on the entity class and tell it what property in the class is the key
    5. To create a custom OData operation
      1. Need to add an OperationAccessRule config.SetServiceOperationAccessRule(“<operationname>”,ServiceOperationRights.All)
      2. Need to attribute the operation as WebGet or WenInvoke

   

Filters and Interceptors:

  1. Query interceptors only apply to GET
    1. You can place security, business rules, additional filtering, or custom expressions on records by userid, customer number, etc..
    2. Allows you to add additional expressions to the query before it executes on the server
  2. Change interceptors only apply to PUT,POST,DELETE
    1. You can put in security,rule validation, input validation
    2. Apply your checks and if something fails throw a new DataServiceException 
    3. intercepts create/update/delete requests and allow you to modify data. Example of interceptor that checks whether the current user has modified a product and sets date modified to the current date is shown

   

Service Operations:

  1. you can add your own operations that returns custom resource sets. This might be helpful if you need to provide pre-compiled queries on the service side.

    [WebGet]
    public IQueryable<Supplier> GetSuppliersByCity(string city)
    {
    	return DataRepository.Suppliers.Where(s => s.Town.Contains(city)).AsQueryable();
    }
  1. /GetSuppliersByCity?city=’Cardiff’&$top=1

   

Providers:

  1. Reflection Provider:
    1. Used for .NET objects or Linq To SQL that support IQueryable
  2. Object Context Provider:
    1. Used for Entity Framework.
    2. Provides Update/Add/Delete capabilities
  3. Custom Provider:
    1. Provides Update/Add/Delete capabilities

   

Query Options:

  1. $ must start any query option
    1. filterorderbytop ,skipselect (grab only certain fields to return) ,inlinecount (full count outside of top), value (no surrounding metadata), expand(embeds sub objects into results)
  2. No aggregate functions allowed

      

WEB API


 Self Hosting:

  1. Get the Nuget package Web API Self Host
  2. Create a HttpSelfHostConfiguration
    1. var config = new HttpSelfHostConfiguration(“http://localhost:8080”);
  3. Add your routes
  4. Create the self hosting server
    1. using (HttpSelfHostServer server = new HttpSelfHostServer(config))
      {
      server.OpenAsync().Wait();
      Console.WriteLine(“Press Enter to quit.”);
      Console.ReadLine();
      }
    2. HttpSelfHostServer derives from HttpMessageHandler
  5. HttpClient needs a HttpMessageHandler passed in to work.
 

Security:

  1. In self hosting HttpMessageHandler we can read the Identity to get logged in user
  2. When creating the self hosting server instance instead of creating a generic HttpSelfHostConfiguration, we want to make our own Configuration class
    1. public class MyConfig: HttpSelfHostConfiguration
    2. Override the OnConfigureBinding
      1. In here set the httpBinding security mode and security transport

   

Custom Media Formatters:

  1. Create a new formatter that derives from MediaTypeFormattter
  2. Add the new SupportedMediaType as a MediaTypeHeaderValue
  3. Override the following
    1. CanReadType 
      1. check the type against what serializing as. 
      2. This writes to the input stream to server. 
      3. This would handle taking the http message body and creating the correct .Net type for the controller action
    2. CanWriteType – check the type against what type you are deserializing as. This writes to the output stream
    3. WriteToStreamAsync
      1. Create a Task
        1. return Task.Factory.StartNew(()=>{});

   

Action Filters:

  1. These are usually attributes you place on controller actions. AuthorizeAttribute is an example of one

   

Message Handlers:

  1. Must derive from DelegatingHandler
  2. Override the SendAsync method
  3. This occurs before the controller action is fired

   

Action Filters vs Message Handlers:

  1. Message Handlers: before the method to invoke as been selected
  2. Action Filter: After the method to invoke has been selected

Entity Framework


Lazy Loading:

  1. Has greedy operators
    1. ToList, ToDictionary, ToArray
    2. Force the query to execute immediately
    3. Average, Count, First, Max also execute the query immediately so a valid result can be determine, but only in the scope of the call. meaning if you call .count() the query is executed, but then on the next line iterate over the query, the query is then executed again. which is bad because of 2 database calls instead of 1. In these cases its best to call ToList() to force query execution and then get the count and iterate over the list.
  2. Streaming
    1. where: gives back 1 value at a time to be evaluated
  3. Non-Streaming
    1. orderby: needs to get all the values back before can execute expression

   

IEnumberable vs IQueryable:

  1. IEnumberable
    1. In-memory operations
    2. Happens on the heap
    3. Usually LINQ to Objects, LINQ to XML
  2. IQueryable
    1. Out of process
      1. some remote data source (SQL, Amazon,Twitter)
    2. LINQ to EF, LINQ to Data Services (Odata)
    3. Transforms to an expression to run against out of process data source

   

Let Keyword:

  1. When using let can cause the query to run less optimized
    1. It basically creates a projection before it executes the rest of the query to get that “variable” value

   

Transactions:

  1. TransactionScope
    1. This is used with entity framework
    2.  using (TransactionScope transaction = new TransactionScope())
      1. To commit call transaction.Complete()
      2. If complete is not called everything will be rolled back
      3. The use of TransactionScope resembles a transaction-processing monitor context in which there is no explicit call to commit the data to storage. Calling the method Complete to collect all the results of processing. If all procedures complete as expected, the data will commit to storage. Any negative result will roll back the transaction. The call to Complete signals the end of processing and calls in the results.
    3. It is possible to with the EntityConnection to perform the below BeginTransaction with entity framework as well. But more times then not you will use the TransactionScope
    4. This uses Microsoft distributed transaction coordinator (DTC)
    5. The TransactionScope is smart enough not to create a fully distributed transaction with all of its overhead unless it is necessary. If the resource involved in the transaction is volatile, everything will stay in memory and the Microsoft distributed transaction coordinator (DTC) will not be involved. If the resource is a connection to SQL Server 2005, the DTC will not be involved, and SQL Server 2005 will handle the transaction. This is equivalent to opening an internal SQL transaction. If SQL Server 2000 is used, it will resolve to using a full DTC transaction.
  2. Connection BeginTransaction
    1. This is used with ADO.net sql
    2. transaction = connection.BeginTransaction(“SampleTransaction”);
    3. command.Transaction = transaction
      1. The command must have a reference to the transaction for all actions to be committed or rolled back
  3. When to use what (found on a forum)
    1. The standard ADO.NET transaction is limited to database transactions (and a single connection).  TransactionScope was added to v2 to allow transaction support across any type of object that can support transactions including databases and business classes.  ADO.NET will actually use the scope transaction if one is available.
    2. Another usage of the scope is to allow distributed transactions across servers which ADO.NET can’t do (I believe).  There are other advantages as well.  Here is a starter article for you: http://msdn.microsoft.com/msdnmag/issues/05/02/DataPoints/
    3. Which to use?  In general if you are working with ADO.NET then stick with BeginTransaction.  TransactionScope is suppose to be optimized for local transactions but my experience has been that it invokes the DTC way to much to warrant the added overhead.  If you want to use some advanced features or use transactions other tha

      

MISC


 Configure assembly binding redirects:

<runtime>
	<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
		<dependentAssembly>
			<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
			<bindingRedirect oldVersion="0.0.0.0-2.0.0.4000" newVersion="2.0.0.4000" />
		</dependentAssembly>
	</assemblyBinding>
</runtime>

   

Connect to a local repository cache for NuGet:

  1. Add you local cache local in AppData to the NuGet package manage package sources

Tags: , , , , , , , , ,

Reader's Comments »

  1. By Blogged By Chris » Microsoft Exam 70-487 Study Guide on January 24, 2013 at 5:24 pm

    […] Microsoft Exam 70-487 Study Notes – Notes & examples study guide for the test that was provided to me by a co-worker     […]

  2. By Stewart on January 28, 2013 at 3:26 pm

    Hey Chris, you deserve a hero status for doing this awesome work. You are awesome, your coworker is awesome, whats next now that you reached the end for this track.

  3. By chris on February 6, 2013 at 5:09 pm

    Thanks Stewart. I’m holding out for the BizTalk 2013 certification to come out. That will be my next cert probably. However, I’m also working on MCSA for SQL Server 2012.

  4. By Stewart on March 15, 2013 at 7:28 pm

    Hey Chris, just thought I would point out the following cool Web API posters,

    http://www.asp.net/posters/web-api/ASP.NET-Web-API-Poster.pdf

    http://www.asp.net/posters/web-api/ASP.NET-Web-API-Poster-grayscale.pdf

    Also the Web API section on http://www.asp.net/web-api/ has a lot of useful material. Happy studying guys.

  5. By Marcos Paulo - Slipmp on April 15, 2013 at 7:49 pm

    Thanks Chris!

    It has a lot of helpful hints!

    Regards,

  6. By law zone on June 7, 2013 at 2:19 pm

    This really is such a great resource that you are comming up with and you give it away for free. I love seeing web sites that vision the welfare of supplying a quality reference for no cost. Thanks for this amazing reference!

  7. By Sudheer on September 24, 2013 at 8:36 am

    Hi Chris…do you have the same kind of study notes for 70-486. If there please post it..it will be very useful.

  8. By chris on September 25, 2013 at 7:52 pm
  9. By Lynn on October 14, 2013 at 4:52 pm

    Incredible resource for developers. Thanks a lot!

  10. […] Click To Read […]

  11. By saurabh on May 22, 2014 at 4:12 am

    perfect. very concise. awesome for quick revision and summary!

  12. By About MS 70-487 certification « Cyberiafreak on April 8, 2015 at 10:49 am

    […] Study notes from Chris – http://www.bloggedbychris.com/2013/01/24/microsoft-exam-70-487-study-notes/ […]

  13. By stretching on September 13, 2015 at 10:16 am

    Very shortly this site will be famous among all blogging and site-building users, due to it’s
    good posts

Leave a Reply