コード例 #1
0
 /// <summary>
 /// Check that data is valid.
 /// </summary>
 /// <param name="reference">The reference instance.</param>
 /// <param name="context">Web service request context.</param>
 public static void CheckData(this WebReference reference,
                              WebServiceContext context)
 {
     reference.CheckNotNull("reference");
     reference.Name.CheckNotEmpty("Name");
     reference.Name = reference.Name.CheckSqlInjection();
     reference.Name.CheckLength(GetNameMaxLength(context));
     reference.Title.CheckNotEmpty("Title");
     reference.Title = reference.Title.CheckSqlInjection();
     reference.Title.CheckLength(GetTitleMaxLength(context));
 }