Permalink
Browse files

only get schema from server if one hasn't been cached for issue #81

  • Loading branch information...
1 parent 08524d9 commit cf74a33732338775823b1ebbabd11a836105da25 @nberardi nberardi committed Oct 22, 2012
Showing with 15 additions and 15 deletions.
  1. +10 −10 src/CassandraColumnFamily.cs
  2. +5 −5 src/CassandraSuperColumnFamily.cs
@@ -26,11 +26,11 @@ public partial class CassandraColumnFamily : BaseCassandraColumnFamily
public CassandraColumnFamily(CassandraContext context, string columnFamily)
: base(context, columnFamily) { }
- public CassandraColumnFamily(CassandraContext context, CassandraColumnFamilySchema schema)
- : base(context, schema.FamilyName)
- {
- _cachedSchema = schema;
- }
+ public CassandraColumnFamily(CassandraContext context, CassandraColumnFamilySchema schema)
+ : base(context, schema.FamilyName)
+ {
+ _cachedSchema = schema;
+ }
public FluentColumnFamily CreateRecord(CassandraObject key)
{
@@ -42,12 +42,12 @@ public FluentColumnFamily CreateRecord(CassandraObject key)
public override CassandraColumnFamilySchema GetSchema()
{
- var schema = Context.Keyspace.GetColumnFamilySchema(FamilyName);
-
- if (_cachedSchema == null)
+ if (_cachedSchema == null) {
+ var schema = Context.Keyspace.GetColumnFamilySchema(FamilyName);
_cachedSchema = (schema == null)
- ? new CassandraColumnFamilySchema(FamilyName, ColumnType.Standard)
- : schema;
+ ? new CassandraColumnFamilySchema(FamilyName, ColumnType.Standard)
+ : schema;
+ }
return _cachedSchema;
}
@@ -43,12 +43,12 @@ public FluentSuperColumnFamily CreateRecord(CassandraObject key)
public override CassandraColumnFamilySchema GetSchema()
{
- var schema = Context.Keyspace.GetColumnFamilySchema(FamilyName);
-
- if (_cachedSchema == null)
+ if (_cachedSchema == null) {
+ var schema = Context.Keyspace.GetColumnFamilySchema(FamilyName);
_cachedSchema = (schema == null)
- ? new CassandraColumnFamilySchema(FamilyName, ColumnType.Super)
- : schema;
+ ? new CassandraColumnFamilySchema(FamilyName, ColumnType.Super)
+ : schema;
+ }
return _cachedSchema;
}

0 comments on commit cf74a33

Please sign in to comment.