In order to get placeholder or maxLength or other Html attributes to work with the Html.EditorFor methods, you need to create an override file in Views\Shared\EditorTemplate... @{ // make placeholder work // http://stackoverflow.com/qu... // from [Display(Prompt = IDictionary<string, object> attributes = new Dictionary<string, object>(); if (!string.IsNullOrEmpty(View... { attributes.Add("placeholder", ......
I created an almost generic approach to interacting with the SignalR hubs. I had to use a string with if statements in the hubFactory method to create the correct hub that matches the name on the server. namespace is defined globally as var namespace = namespace || {}; /*global namespace, $ */ /// <reference path="../jquery.signalR-0.5... /> // file: Scripts\custom\HubsService.js // // summary: All SignalR hubs interaction will go through this class so that the classes can be testable. namespace.HubsService ......
If you try to dependency injection into a constructor with WebAPI, you’ll get an exception that says you need a parameter less constructor. The same is true for MVC controllers, but that is a different topic. Microsoft contains a good guide on how to get this working. There is also a useful StructureMap.DependencyReso... nuget package by statish860 that does it for you. Get the nuget package, then add GlobalConfiguration.Configu... = new DependencyResolver(ObjectFa... ......
Go to http://www.microsoft.com/le... get the voucher before March 2013 and before they run out.EDIT: ** I just heard from a co-worker and a comment from a reader that they HTMLJMP promotion code is no longer working. My co-worker said he thought they ran out. ** February 21st, 2013. You can still get a second chance https://www.microsoft.com/l... as long as that is still valid.EDIT: 3 for 1 offer until May 31, 2014: http://www.microsoftvirtual... ......
I needed to Fake the DbSet of a DBContext in EF 5 so that I could test my caching implementation. I searched for awhile and found this link on creating an in memory DbSet. I first copied the code in and created an InMemoryDbSet class. Then I changed all my DbSets in my DBContext to IDbSet. Then I was able to mock the call to UserProfiles and return a dummy object. The Test I’m using FakeItEasy which is a nuget packages. Notice the usage of the InMemoryDbSet<UserProfil... [TestInitialize] public ......