This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Boolean IsDirtyEntity(this ISession session, Object entity) | |
{ | |
return (DirtyPropertiesOf(session, entity).Any()); | |
} | |
public static IEnumerable<string> DirtyPropertiesOf(this ISession session, Object entity) | |
{ | |
String className = NHibernateProxyHelper.GuessClass(entity).FullName; | |
ISessionImplementor sessionImpl = session.GetSessionImplementation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool mystery(uint num){ | |
uint other = num - 1; | |
bool result = ((num & other) == 0); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="ConsoleApplication1" namespace="ConsoleApplication1"> | |
<sql-query name="CatById"> | |
<return class="Category"></return> | |
EXEC CatById :id | |
</sql-query> | |
</hibernate-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Expression<Func<TEntity, TReturn>> GetFieldExpression<TEntity, TReturn>(string fieldName) | |
{ | |
var type = typeof(TEntity); | |
var member = type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) | |
.FirstOrDefault(x => x.Name == fieldName); | |
if (member == null) | |
throw new UnknownPropertyException(type, fieldName); | |
var param = Expression.Parameter(member.DeclaringType, "x"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handleException = new Action<Exception>(e => | |
{ | |
Console.WriteLine("Handle Exception: " + e); | |
}); | |
var someCodeThatThrowsAnException = new Action(() => | |
{ | |
try | |
{ | |
throw new Exception("I threw an Exception!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
COUNT([QUEUENAME].[conversation_handle]) | |
FROM [QUEUENAME] | |
INNER JOIN sys.service_message_types | |
ON [QUEUENAME].[message_type_id] = sys.service_message_types.[message_type_id] | |
INNER JOIN sys.conversation_endpoints | |
ON [QUEUENAME].[conversation_handle] = sys.conversation_endpoints.[conversation_handle] | |
WHERE sys.service_message_types.name = 'NServiceBusTransportMessage' | |
AND sys.conversation_endpoints.security_timestamp > @minDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static TimeZoneInfo ToTimeZoneInfo(this TimeZones zone) { | |
switch (zone) { | |
case TimeZones.Central: | |
return TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); | |
case TimeZones.Mountain: | |
return TimeZoneInfo.FindSystemTimeZoneById("Mountain Standard Time"); | |
case TimeZones.Pacific: | |
return TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); | |
case TimeZones.Arizona: | |
return TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SplitGuids]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) | |
DROP FUNCTION [dbo].[SplitGuids] | |
GO | |
CREATE FUNCTION [dbo].[SplitGuids] | |
( | |
@List varchar(2000) | |
) | |
RETURNS | |
@ParsedList table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script> | |
if (typeof (nfvalidate) == "undefined") nfvalidate = {}; | |
// An array of validators to push your validators to | |
nfvalidate.validators = new Array(); | |
nfvalidate.validators.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserSettings> | |
<ApplicationIdentity version="9.0"/> | |
<ToolsOptions> | |
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"> | |
<ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package"> | |
<PropertyValue name="ShowMiscFilesProject">false</PropertyValue> | |
<PropertyValue name="AutoloadExternalChanges">false</PropertyValue> | |
<PropertyValue name="CheckForConsistentLineEndings">false</PropertyValue> | |
<PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue> | |
<PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue> |
OlderNewer