コード例 #1
0
 /// <summary>
 /// assing a new id if not provided
 /// </summary>
 /// <param name="struct"></param>
 public static void AssignIdIfNot(this IIdBased @struct)
 {
     if (string.IsNullOrEmpty(@struct.Id))
     {
         @struct.Id = ObjectId.GenerateNewId().ToString();
     }
 }
コード例 #2
0
 /// <summary>
 /// assing a new id to an entity object
 /// </summary>
 /// <param name="struct"></param>
 public static void AssignId(this IIdBased @struct)
 {
     @struct.Id = ObjectId.GenerateNewId().ToString();
 }