Пример #1
0
        /// <summary>
        /// Upsert an edge and maintain its
        /// </summary>
        /// <typeparam name="TEdge"></typeparam>
        /// <typeparam name="TFrom"></typeparam>
        /// <typeparam name="TTo"></typeparam>
        /// <param name="arangoDatabase"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <param name="setter"></param>
        /// <returns></returns>
        public static TEdge UpsertEdgeUniqueFrom <TEdge, TFrom, TTo>(this IArangoDatabase arangoDatabase, TFrom from, TTo to, Action <TEdge> setter = null) where TEdge : EdgeBase, new() where TFrom : VertexBase where TTo : VertexBase
        {
            TEdge edge = new TEdge();

            edge._from = from.GetId();
            edge._to   = to.GetId();
            edge.BuildIdWithFromTo();
            setter?.Invoke(edge);
            arangoDatabase.UpsertEdgeUniqueFrom(edge);
            return(edge);
        }