CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of 3.5
Data units of msec resolution = 0.000301 usec
10 typeof(string)                       : count: 10000    0.285 +- 0%    msec
10 typeof(string).TypeHandle            : count: 10000    0.030 +- 3%    msec
10 anObj.GetType() == type              : count: 10000    0.444 +- 6%    msec
10 Type.GetTypeHandle(obj).Equals(tHnd) : count: 10000    0.589 +- 1%    msec
10 anObj.GetType() == typeof(string)    : count: 10000    0.057 +- 2%    msec
10 (anObj is string)                    : count: 10000    0.113 +- 10%   msec
by Athens Springer   October 30, 2009 @ 9:14am
452 Views
no comments
 
C#
private T GetRepeaterItemValue<T>(RepeaterItem item, string controlId)
   {
       T controlValue = default(T);
 
       if (item != null && !String.IsNullOrEmpty(controlId))
       {
           var control = item.FindControl(controlId);
 
           if (control is DropDownList)
           {
by kannan M ambadi   September 06, 2009 @ 11:13am
581 Views
no comments
 
C#
public static class A
{
   private static Func<MyContextEntities, int, Orders> compiledGetById;
 
  static A()
  {
     compiledGetById = CompiledQuery.Compile<MyContextEntities, int, Orders>(((ctxt, orderId) => (from o in ctxt.Orders where o.Id == orderId select o).FirstOrDefault()));
  }
 
  public static Orders GetOrderById(int orderId)
457 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate