implements a read only data access,

data that is not intent to be changed
This commit is contained in:
Paul Schneider 2016-09-18 00:21:27 +02:00
commit 45c5c1b57b

View file

@ -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);
}
}
}