func (esmc *ExplicitSkippedMessageCreate) Save(ctx context.Context) (*ExplicitSkippedMessage, error) {
	var (
		err  error
		node *ExplicitSkippedMessage
	)
	if len(esmc.hooks) == 0 {
		if err = esmc.check(); err != nil {
			return nil, err
		}
		node, err = esmc.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*ExplicitSkippedMessageMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			if err = esmc.check(); err != nil {
				return nil, err
			}
			esmc.mutation = mutation
			if node, err = esmc.sqlSave(ctx); err != nil {
				return nil, err
			}
			mutation.id = &node.ID
			mutation.done = true
			return node, err
		})
		for i := len(esmc.hooks) - 1; i >= 0; i-- {
			if esmc.hooks[i] == nil {
				return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = esmc.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, esmc.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}
Save creates the ExplicitSkippedMessage in the database.
package ent
import (
	"context"
	"fmt"
	"entgo.io/contrib/entproto/internal/entprototest/ent/explicitskippedmessage"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type ExplicitSkippedMessageCreate struct {
	config
	mutation *ExplicitSkippedMessageMutation
	hooks    []Hook
}
func (esmc *ExplicitSkippedMessageCreate) Mutation() *ExplicitSkippedMessageMutation {
	return esmc.mutation
}