コード例 #1
0
 /// <summary>
 /// Save the entity record. If it has a valid Id it will be updated, otherwise new record created.
 /// </summary>
 /// <param name="bag"></param>
 /// <param name="entity"></param>
 public static void Save(this IBag bag, Entity entity)
 {
     if (entity.Id.Equals(Guid.Empty))
     {
         bag.Create(entity);
     }
     else
     {
         bag.Update(entity);
     }
 }