func (m *GormIdentityRepository) First(funcs ...func(*gorm.DB) *gorm.DB) (*Identity, error) {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "first"}, time.Now())
	var objs []*Identity
	log.Debug(nil, nil, "Looking for identity matching: %v", funcs)

	err := m.db.Scopes(funcs...).Table(m.TableName()).First(&objs).Error
	if err != nil && err != gorm.ErrRecordNotFound {
		return nil, errors.WithStack(err)
	}
	if len(objs) != 0 && objs[0] != nil {
		log.Debug(nil, map[string]interface{}{
			"identity_list": objs,
		}, "Found matching identity: %v", *objs[0])
		return objs[0], nil
	}
	log.Debug(nil, map[string]interface{}{
		"identity_list": objs,
	}, "No matching identity found")
	return nil, nil
}
// First returns the first Identity element that matches the given criteria
First returns the first Identity element that matches the given criteria
// First returns the first Identity element that matches the given criteria
func (m *GormIdentityRepository) First(funcs ...func(*gorm.DB) *gorm.DB) (*Identity, error) {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "first"}, time.Now())
	var objs []*Identity
	log.Debug(nil, nil, "Looking for identity matching: %v", funcs)
	err := m.db.Scopes(funcs...).Table(m.TableName()).First(&objs).Error
	if err != nil && err != gorm.ErrRecordNotFound {
		return nil, errors.WithStack(err)
	}
	if len(objs) != 0 && objs[0] != nil {
		log.Debug(nil, map[string]interface{}{
			"identity_list": objs,
		}, "Found matching identity: %v", *objs[0])
		return objs[0], nil
	}
	log.Debug(nil, map[string]interface{}{
		"identity_list": objs,
	}, "No matching identity found")
	return nil, nil
}
func ( m * GormIdentityRepository ) First ( funcs ... func ( * gorm . DB ) * gorm . DB ) ( * Identity , error ) { defer goa . MeasureSince ( [ ] string { " " , " " , " " , " " } , time . Now ( ) ) var objs [ ] * Identity log . Debug ( nil , nil , " " , funcs ) err := m . db . Scopes ( funcs ... ) . Table ( m . TableName ( ) ) . First ( & objs ) . Error if err != nil && err != gorm . ErrRecordNotFound { return nil , errors . WithStack ( err ) } if len ( objs ) != 0 && objs [ 0 ] != nil { log . Debug ( nil , map [ string ] interface { } { " " : objs , } , " " , * objs [ 0 ] ) return objs [ 0 ] , nil } log . Debug ( nil , map [ string ] interface { } { " " : objs , } , " " ) return nil , nil }
First returns the first Identity element that matches the given criteria
First returns the first Identity element that matches the given criteria