public static void UpdateItem(SampleModel postedItem) { var editedModel = SampleModelList.GetData().First(i => i.ID == postedItem.ID); editedModel.SampleString = postedItem.SampleString; editedModel.SampleBool = postedItem.SampleBool; editedModel.SampleDate = postedItem.SampleDate; editedModel.SampleDecimal = postedItem.SampleDecimal; }
public static void DeleteItem(int ID) { var deleteItem = SampleModelList.GetData().First(i => i.ID == ID); SampleModelList.GetData().Remove(deleteItem); }
public static void AddItem(SampleModel postedItem) { SampleModelList.GetData().Add(postedItem); }