implements a read only data access,

data that is not intent to be changed
main
Paul Schneider 9 years ago
parent f1cf4276bc
commit e85821ce66
1 changed files with 24 additions and 0 deletions

@ -0,0 +1,24 @@
using BookAStar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookAStar.Helpers
{
class RemoteEntityRO<V,K>: RemoteEntity<V,K> where K: IEquatable<K>
{
public RemoteEntityRO (string controllerName,
Func<V,K> getKey) : base(controllerName,getKey)
{
}
protected override void UpdateOrAdd(V item)
{
var key = GetKey(item);
if (this.Any(x => GetKey(x).Equals(key))) { return; }
Add(item);
}
}
}
Loading…