public static Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> > GetDefaultTable( ISession session, string tableName) { // create table var config = new MappingConfiguration().Define( new Map <EntityWithDictionaryType>() .TableName(tableName) .PartitionKey(u => u.Id)); var table = new Table <EntityWithDictionaryType>(session, config); var entityList = EntityWithDictionaryType.GetDefaultEntityList(); return(new Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> >(table, entityList)); }
public static Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> > SetupDefaultTable(ISession session) { // create table var config = new MappingConfiguration().Define( new Map <EntityWithDictionaryType>() .TableName($"EntityWithDictionaryType_{Randomm.RandomAlphaNum(12)}") .PartitionKey(u => u.Id)); var table = new Table <EntityWithDictionaryType>(session, config); table.Create(); var entityList = EntityWithDictionaryType.GetDefaultEntityList(); //Insert some data foreach (var singleEntity in entityList) { table.Insert(singleEntity).Execute(); } return(new Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> >(table, entityList)); }