public void Update(IDefaultEntity entity) { var type = entity.GetType(); var id = entity.GetId(); if (repository.GetSingle(type, id) == null) { return; } repository.DeepUpdate(entity); }
public void Add(IDefaultEntity entity) { var type = entity.GetType(); var id = entity.GetId(); if (repository.GetSingle(type, id) != null) { return; } repository.Add(entity); }