func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error) {
	if pc.create_time == nil {
		v := project.DefaultCreateTime()
		pc.create_time = &v
	}
	if pc.update_time == nil {
		v := project.DefaultUpdateTime()
		pc.update_time = &v
	}
	if pc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if err := project.NameValidator(*pc.name); err != nil {
		return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
	}
	if len(pc._type) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"type\"")
	}
	if pc._type == nil {
		return nil, errors.New("ent: missing required edge \"type\"")
	}
	if len(pc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	return pc.sqlSave(ctx)
}
// Save creates the Project in the database.
Save creates the Project in the database.
// Save creates the Project in the database .
func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error) {
	if pc.create_time == nil {
		v := project.DefaultCreateTime()
		pc.create_time = &v
	}
	if pc.update_time == nil {
		v := project.DefaultUpdateTime()
		pc.update_time = &v
	}
	if pc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if err := project.NameValidator(*pc.name); err != nil {
		return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
	}
	if len(pc._type) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"type\"")
	}
	if pc._type == nil {
		return nil, errors.New("ent: missing required edge \"type\"")
	}
	if len(pc.location) > 1 {
		return nil, errors.New("ent: multiple assignments on a unique edge \"location\"")
	}
	return pc.sqlSave(ctx)
}
func ( pc * ProjectCreate ) Save ( ctx context . Context ) ( * Project , error ) { if pc . create_time == nil { v := project . DefaultCreateTime ( ) pc . create_time = & v } if pc . update_time == nil { v := project . DefaultUpdateTime ( ) pc . update_time = & v } if pc . name == nil { return nil , errors . New ( " \" \" " ) } if err := project . NameValidator ( * pc . name ) ; err != nil { return nil , fmt . Errorf ( " \" \" " , err ) } if len ( pc . _type ) > 1 { return nil , errors . New ( " \" \" " ) } if pc . _type == nil { return nil , errors . New ( " \" \" " ) } if len ( pc . location ) > 1 { return nil , errors . New ( " \" \" " ) } return pc . sqlSave ( ctx ) }
Save creates the Project in the database.
Save creates the Project in the database .