public Entity CreateEntity(string containerTitle, string path, string title, string @namespace, string data) { var newId = Guid.NewGuid(); var packagePath = GetEntityPackagePath(containerTitle, path, newId); if (File.Exists(packagePath)) { throw new InvalidOperationException("An entity with the specified id already exists."); } using (var package = EntityPackage.Create(packagePath, newId, @namespace, title, data)) { return(package.MapEntityFromPackage(true)); } }