1: var row = $(this).closest('tr');
2: var description = row.find('td:eq(1)').text();
3: var code = row.find('td:eq(0)').text();
1: var row = $(this).closest('tr');
2: var description = row.find('td:eq(1)').text();
3: var code = row.find('td:eq(0)').text();
I must remember this
container.Register(Component.For<IMappingEngine>().UsingFactoryMethod(()=> Mapper.Engine));
I keep forgetting how to do this should I’ll post it here.
Database.SetInitializer<DataContext>(null);While working on web site for a client in Belgium I was wondering why the Required attribute error message wasn’t being localised based on the CurrentUICulture of the thread.
This was bugging me, so I downloaded the MVC 3 source code from CodePlex and found the Required attribute unit test. Even after changing the thread to use Flemish the below test still passed.
After talking to Damian we found that there are Language Packs for .NET 4. These can be obtained from http://www.microsoft.com/download/en/details.aspx?id=3324.
These packs will install the required resources in you .Net 4 framework directory.
As soon as I installed the Dutch language pack the above test failed as expected.
I still need to test what gets stored in the logs when these packs are installed and an exception is thrown. It won’t help us much if errors in the logs start getting stored in the language of the user that is logged in.
While you can add the data-val attributes for MVC client side validation by default MVC unobtrusive validation won’t process them.
What you have to do is remove the validators and re-add them.
1: $("#Password").attr("data-val-required", "Password is required");
2: $("form").removeData("validator");
3: $("form").removeData("unobtrusiveValidation");
4: $.validator.unobtrusive.parse("form");
It took me a little while to track this down so I’m posting it here. If you have resolvers that need DI you can get Automapper to use Windsor using the below.
1: Mapper.Initialize(x => x.ConstructServicesUsing(_container.Resolve));I’m always forgetting this. If you want to use wcf using an assembly instead of a code file here is what you have to do.
1: <%@ ServiceHost Service="<Concrete Class>" %>
1: <service behaviorConfiguration="tricoder_serviceBehavior" name="<Concrete Class">
2: <endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
3: contract="Interface with contracts" >
4: </endpoint>
5: <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
6: </service>
7: </services>
And make sure that you use the full name of the concrete class and the interface.