public void Update(LomoConfig lomoConfig) { var toReplace = LomoConfigs.Single(config => config.Id == lomoConfig.Id); var id = lomoConfigs.IndexOf(toReplace); if (id != -1) { lomoConfigs.RemoveAt(id); lomoConfigs.Insert(id, lomoConfig); } }
public int Add(LomoConfig lomoConfig) { if (lomoConfig.Id.HasValue) { throw new InvalidOperationException("The entity should not explicitly choose its Id. It should be set to null."); } var newId = GenerateNewId(); lomoConfigs.Add(lomoConfig); lomoConfig.Id = newId; return newId; }
public void Update(LomoConfig lomoConfig) { lomoConfig.Id = 1; }
protected bool Equals(LomoConfig other) { return Id == other.Id; }
public int Add(LomoConfig lomoConfig) { throw new System.NotImplementedException(); }