Optimization

main
Inga 🏳‍🌈 14 years ago
parent 57d98db332
commit 82d1227218
  1. 4
      Common/dataobjects/Board.cs
  2. 8
      Common/dataobjects/Category.cs

@ -153,7 +153,7 @@ namespace FLocal.Common.dataobjects {
from id in Cache<IEnumerable<int>>.instance.get( from id in Cache<IEnumerable<int>>.instance.get(
this.subBoards_Locker, this.subBoards_Locker,
() => { () => {
IEnumerable<int> ids = from stringId in Config.instance.mainConnection.LoadIdsByConditions( IEnumerable<int> ids = (from stringId in Config.instance.mainConnection.LoadIdsByConditions(
TableSpec.instance, TableSpec.instance,
new FLocal.Core.DB.conditions.ComparisonCondition( new FLocal.Core.DB.conditions.ComparisonCondition(
TableSpec.instance.getColumnSpec(Board.TableSpec.FIELD_PARENTBOARDID), TableSpec.instance.getColumnSpec(Board.TableSpec.FIELD_PARENTBOARDID),
@ -161,7 +161,7 @@ namespace FLocal.Common.dataobjects {
this.id.ToString() this.id.ToString()
), ),
Diapasone.unlimited Diapasone.unlimited
) select int.Parse(stringId); ) select int.Parse(stringId)).ToList();
Board.LoadByIds(ids); Board.LoadByIds(ids);
return ids; return ids;
} }

@ -55,11 +55,11 @@ namespace FLocal.Common.dataobjects {
from id in Cache<IEnumerable<int>>.instance.get( from id in Cache<IEnumerable<int>>.instance.get(
allCategories_Locker, allCategories_Locker,
() => { () => {
IEnumerable<int> ids = from stringId in Config.instance.mainConnection.LoadIdsByConditions( IEnumerable<int> ids = (from stringId in Config.instance.mainConnection.LoadIdsByConditions(
TableSpec.instance, TableSpec.instance,
new FLocal.Core.DB.conditions.EmptyCondition(), new FLocal.Core.DB.conditions.EmptyCondition(),
Diapasone.unlimited Diapasone.unlimited
) select int.Parse(stringId); ) select int.Parse(stringId)).ToList();
Category.LoadByIds(ids); Category.LoadByIds(ids);
return ids; return ids;
} }
@ -80,7 +80,7 @@ namespace FLocal.Common.dataobjects {
from id in Cache<IEnumerable<int>>.instance.get( from id in Cache<IEnumerable<int>>.instance.get(
this.subBoards_Locker, this.subBoards_Locker,
() => { () => {
IEnumerable<int> ids = from stringId in Config.instance.mainConnection.LoadIdsByConditions( IEnumerable<int> ids = (from stringId in Config.instance.mainConnection.LoadIdsByConditions(
Board.TableSpec.instance, Board.TableSpec.instance,
new FLocal.Core.DB.conditions.ComparisonCondition( new FLocal.Core.DB.conditions.ComparisonCondition(
Board.TableSpec.instance.getColumnSpec(Board.TableSpec.FIELD_CATEGORYID), Board.TableSpec.instance.getColumnSpec(Board.TableSpec.FIELD_CATEGORYID),
@ -88,7 +88,7 @@ namespace FLocal.Common.dataobjects {
this.id.ToString() this.id.ToString()
), ),
Diapasone.unlimited Diapasone.unlimited
) select int.Parse(stringId); ) select int.Parse(stringId)).ToList();
Board.LoadByIds(ids); Board.LoadByIds(ids);
return ids; return ids;
} }

Loading…
Cancel
Save