This question is locked. New answers and comments are not allowed.
public string CreateEntity<T>(T entity) |
{ |
try |
{ |
this.scope.Add(entity); |
IObjectId entityId = Database.GetObjectId(entity); |
return entityId.ToString(); |
} |
catch (Telerik.OpenAccess.OpenAccessException ex) |
{ |
this.RollBackTransaction(this.scope); |
throw ex; |
} |
} |
/// <summary> |
/// Create entities. |
/// </summary> |
/// <typeparam name="T"></typeparam> |
/// <param name="entities"></param> |
/// <returns></returns> |
public int CreateEntities<T>(List<T> entities) |
{ |
foreach (T t in entities) |
{ |
CreateEntity(t); |
} |
scope.Transaction.Commit(); |
return entities.Count(); |
} |
I wondee if that method is more faster in the create method.