本文介绍了寻找物体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在设计一个库系统,可能需要使用以下调用搜索存储在基于对象的数据模型中的数据对象:
I am designing a library system, which may require the searching of data objects stored within an object-based data model, using the following calls:
public String search(String searchTerm) { return "Not found"; }
public ulong search(ulong MediaID) {//TODO }
private ulong mediaID;
private ulong ContactID;
private DateTime TakenOn;
private DateTime ReturnBy;
public void addItem(BooksAndMediaOnLoan BooksAndMediaOnLoan) { this.BooksAndMediaOnLoanToCustomers.Add(BooksAndMediaOnLoan); }
public void removeItem(BooksAndMediaOnLoan BooksAndMediaOnLoan) { this.BooksAndMediaOnLoanToCustomers.Remove(BooksAndMediaOnLoan); }
private List<BooksAndMediaOnLoan> BooksAndMediaOnLoanToCustomers = new List<BooksAndMediaOnLoan>();
你会怎么建议呢?
How would you suggest going about it?
推荐答案
return BooksAndMediaOnLoanToCustomers.Where(b => b.mediaId == mediaId).ToList();
这篇关于寻找物体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!