示例#1
0
文件: FarmSystem.cs 项目: yuuhhe/db4o
 public float CowAverage(Cow cow, DateTime begin, DateTime end)
 {
     return((from m in MilkingsForPeriod(begin, end)
             where m.Cow == cow
             select m.Amount).Average());
 }
示例#2
0
文件: FarmSystem.cs 项目: yuuhhe/db4o
 public void CustomEvent(Cow cow, DateTime date, string id)
 {
     _container.Set(new CustomCowEvent {
         Cow = cow, Date = date, Id = id
     });
 }
示例#3
0
文件: FarmSystem.cs 项目: yuuhhe/db4o
 public void Track(Cow cow)
 {
     _container.Set(cow);
 }
示例#4
0
文件: FarmSystem.cs 项目: yuuhhe/db4o
 public void Milked(Cow cow, DateTime date, float amount)
 {
     _container.Set(new Milking {
         Cow = cow, Date = date, Amount = amount
     });
 }
示例#5
0
文件: FarmSystem.cs 项目: yuuhhe/db4o
 public float OptimizedCowTotal(Cow cow, DateTime begin, DateTime end)
 {
     return((from Milking m in OptimizedMilkings(cow, begin, end) select m.Amount).Sum());
 }