private void BeforeSave(HasId document) { if (document.GetId().IsEmpty()) { document.SetId(Guid.NewGuid().ToString()); } }
public static bool HasId(this HasId target, object id) { return(Equals(target.GetId(), id)); }