|
@@ -448,7 +448,20 @@ namespace InABox.Core
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ public static class EntityExtensions
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// Sets the ID of an <see cref="Entity"/> while it is not observing, so that the change isn't registered.
|
|
|
+ /// </summary>
|
|
|
+ public static T SetID<T>(this T entity, Guid id)
|
|
|
+ where T : Entity
|
|
|
+ {
|
|
|
+ entity.SetObserving(false);
|
|
|
+ entity.ID = id;
|
|
|
+ entity.SetObserving(true);
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public static class EntityFactory
|
|
|
{
|