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 for: dvdstelt
C#
// search for the most "deepest" inner exception
string mostInnerException = "";
Exception innerException = ex.InnerException;
if (innerException != null)
    while (innerException.InnerException != null)
        innerException = innerException.InnerException;
if (innerException != null)
    mostInnerException = innerException.ToString();
 
// init log info
by dvdstelt   March 25, 2010 @ 5:42am
288 Views
no comments
 
C#
// Take into account exceptions might occur
try
{
  // some code here that's less funny ;-)
}
// Process exceptions
catch (Exception ex)
{
}
by dvdstelt   March 08, 2010 @ 12:53am
Tags: dailywtf
260 Views
1 comments
 
C#
public interface IRepository<TEntity> where TEntity : EntityObject
{
   TEntity GetById(int id);
   IQueryable<TEntity> GetAll();
 
   IQueryable<TEntity> Query();
 
   IRepository<TEntity> With(Expression<Func<TEntity, object>> path);
   IRepository<TEntity> With<T>(Expression<Func<T, object>> path);
}
by Dennis van der Stelt   July 22, 2009 @ 5:25am
581 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