private List <TModel> FilterOutById(List <TModel> itemsList, int id)
 {
     return(itemsList
            .Where(item => (int)typeof(TModel)
                   .GetProperty(ModelBase.GetIdPropertyName())
                   .GetValue(item) != id)
            .ToList());
 }
 private bool DoesItemExistsInGivenList(List <TModel> itemsList, int id)
 {
     return(itemsList.Exists(x => (int)typeof(TModel)
                             .GetProperty(ModelBase.GetIdPropertyName())
                             .GetValue(x) == id));
 }
 public TModel GetItemById(int id)
 {
     return(GetItemsList().FirstOrDefault(item => (int)typeof(TModel)
                                          .GetProperty(ModelBase.GetIdPropertyName())
                                          .GetValue(item) == id));
 }