Igor Lukanin at Konfur, November 2015
public Guid Id { get; set; }
public string Inn { get; set; }
public List<PaperDocument> PaperDocuments { get; set; }
public List<RknNotification> RknNotifications { get; set; }
// 42 more properties like this
void Remove(Guid id);
void Save(Company company);
Company Find(Guid id);
Company FindByUid(string uid);
IEnumerable<Company> FindByInn(string inn);
IEnumerable<Company> FindWithRknNotifications();
// 13 more methods like this
public IEnumerable<Company> FindByInn(string inn) {
return mongoCollection.AsQueryable()
.Where(company => company.Inn == inn)
.Select(Prepare);
}
// Many more complicated queries
public void Save(Company company) {
collection.Save(PrepareSave(company));
}
// Stored in database and Calculated data
Stored0 + Calculated0 = Prepare (Stored0)
Stored1 + Calculated1 = Process (Stored0 + Calculated0)
Stored2 = PrepareSave(Stored1 + Calculated1)
public IEnumerable<Company> FindAll()
return mongoCollection.FindAll();
}
// Stored in database and Calculated data
Stored0 + Calculated0 = Stored0
Stored1 + Calculated1 = Process (Stored0 + Calculated0)
Stored2 = PrepareSave(Stored1 + Calculated1)