示例#1
0
        public static T ReadSingle <T>(this IHop hopper, T instance) where T : class, new()
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance", "ReadSingle method expects an instance to read, not null.");
            }

            return(hopper.Read(new[] { instance }).FirstOrDefault());
        }
示例#2
0
 public static T ReadSingle <T>(this IHop hopper, string whereClause = "") where T : new()
 {
     return(hopper.Read <T>(whereClause).FirstOrDefault());
 }