internal StorageCommand(EntityBase argument) { if (argument == null) { throw new Exception("The entity should be null"); } _entities.Add(argument); _entityType = argument.GetType(); _mode = StorageCommandMode.Entity; SetCommandType(); }
internal StorageCommand(EntityBase entity, PropertyDescription pd) { if (entity == null) { throw new Exception("The entity should be null"); } _propertyDescription = pd; if (!_propertyDescription.IsManyToManyRelation) { throw new Exception("A many-to-many relation expected"); } _entities.Add(entity); _entityType = entity.GetType(); _mode = StorageCommandMode.MtmRelation; SetCommandType(); }
internal StorageCommand(List <EntityBase> argument) { if (argument == null || argument.Count == 0) { throw new Exception("The entity list should not be empty"); } _entityType = argument[0].GetType(); foreach (EntityBase e in argument) { if (e.GetType() != _entityType) { throw new Exception("All element of the entity list must of the same type"); } } _entities = argument; _mode = StorageCommandMode.Entity; SetCommandType(); }
internal StorageCommand(List <EntityBase> entities, PropertyDescription pd) { if (entities == null || entities.Count == 0) { throw new Exception("The entity list should not be empty"); } if (!_propertyDescription.IsManyToManyRelation) { throw new Exception("A many-to-many relation expected"); } _entityType = entities[0].GetType(); foreach (EntityBase e in entities) { if (e.GetType() != _entityType) { throw new Exception("All element of the entity list must of the same type"); } } _propertyDescription = pd; _entities = entities; SetCommandType(); _mode = StorageCommandMode.MtmRelation; }