Geeks With Blogs
Rohit Gupta Engaging talk on Microsoft Technologies ....My Resume
June 2010 Entries
Entity Framework v4 – Tips and Tricks
Some of the new Features in EF v4 are : context.ContextOptions.Lazy... is “true” by default. What this means is that if you access a Navigation Property (which returns either a EntityCollection or a EntityReference) of an Entity and if that Navigated Entity (or Entity collection) is not found in the ObjectContext then the ObjectContext automatically loads it when the NavigationProperty is accessed. This means additional round trip to the database for each Navigated entity. If you need ......

Posted On Wednesday, June 23, 2010 7:40 AM

Using Different log4net files for Error and Info messages
If you need to use one log4net file name for Messages having Level between WARN and ERROR and a different filename for Messages having Level between INFO AND DEBUG, then use the following log4net config: 1: <log4net> 2: <appender name="RollingFileAppenderInfo" type="log4net.Appender.Roll... 3: <file type="log4net.Util.PatternS... value="Results\%property{Lo... /> 4: <appendToFile value="true" /> 5: <rollingStyle value="Size" /> 6: <maxSizeRollBackups ......

Posted On Wednesday, June 23, 2010 5:58 AM

Search All Columns in All Tables using TSQL
1…Works like a charm: 1: DECLARE @SearchStr nvarchar(100) 2: 3: SET @SearchStr = 'SEARCH_KEYWORD' 4: 5: CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) 6: 7: SET NOCOUNT ON 8: 9: DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) 10: SET @TableName = '' 11: SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''') 12: 13: WHILE @TableName IS NOT NULL 14: BEGIN 15: SET @ColumnName = '' 16: SET @TableName = 17: ( 18: SELECT MIN(QUOTENAME(TABLE_SCHEMA) ......

Posted On Friday, June 18, 2010 5:06 AM

Unit testing internal methods in a strongly named assembly/project
If you need create Unit tests for internal methods within a assembly in Visual Studio 2005 or greater, then we need to add an entry in the AssemblyInfo.cs file of the assembly for which you are creating the units tests for. For e.g. if you need to create tests for a assembly named FincadFunctions.dll & this assembly contains internal/friend methods within which need to write unit tests for then we add a entry in the FincadFunctions.dll’s AssemblyInfo.cs file like so : 1: [assembly: System.Runtime.CompilerServ... ......

Posted On Monday, June 7, 2010 11:01 AM

Copyright © Rohit Gupta | Powered by: GeeksWithBlogs.net