public void Delete(T entity) { if (entity.Id == Guid.Empty) { throw IEntityIDNotSetException.ExceptionForDeleteFail <T>(); } DeleteByID(entity.Id); }
public void Add(T entity) { if (entity.Id == Guid.Empty) { throw IEntityIDNotSetException.ExceptionForInsertFail <T>(); } _collection.Insert(entity); }
public void Update(T entity) { if (entity.Id == Guid.Empty) { throw IEntityIDNotSetException.ExceptionForUpdateFail <T>(); } entity.UpdatedDateUtc = DateTimeOffset.UtcNow; _collection.Save <T>(entity); }